OxL Справочник OxL
РусскийEnglish

method View.encoded

The encoded bytes the view reads (shared, not copied).

Example:

oxl✓ проверяется в CI
use std.ser { encode }
use std.core { decode_view }

fn main() io {
  let buf = encode(&(42 as i64))!
  let v = decode_view<i64>(&buf)!
  print("{v.encoded().len() == buf.len()}")
}
Вывод
true
pub(api) fn encoded() -> bytes

Сложность. O(1): the bytes are shared, not copied.

С версии. 1.0.0-beta

Возвращает

bytes

Эффекты

не объявлены (чистая, пока тело не говорит иное)

Определено в: std/core/view.oxl:82

См. также