pub enum Scalars {
Bool(Vec<bool>),
U8(Vec<u8>),
U16(Vec<u16>),
U32(Vec<u32>),
U64(Vec<u64>),
I8(Vec<i8>),
I16(Vec<i16>),
I32(Vec<i32>),
I64(Vec<i64>),
F32(Vec<f32>),
F64(Vec<f64>),
}Expand description
A run of scalars held in its native Rust form.
Building a list<f32> of 1,536 elements as Value::List allocates 1,536
Value enums before a single byte is written — fine for a one-off
conversion, wrong for a hot write path. This carries the values as they
already are, and the encoder writes the whole run in one pass.
The output is byte-identical to the equivalent Value::List, so this is
purely a cost choice and never a wire-format one.
Variants§
Bool(Vec<bool>)
U8(Vec<u8>)
U16(Vec<u16>)
U32(Vec<u32>)
U64(Vec<u64>)
I8(Vec<i8>)
I16(Vec<i16>)
I32(Vec<i32>)
I64(Vec<i64>)
F32(Vec<f32>)
F64(Vec<f64>)
Implementations§
Trait Implementations§
impl StructuralPartialEq for Scalars
Auto Trait Implementations§
impl Freeze for Scalars
impl RefUnwindSafe for Scalars
impl Send for Scalars
impl Sync for Scalars
impl Unpin for Scalars
impl UnsafeUnpin for Scalars
impl UnwindSafe for Scalars
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more