pub trait Pushable: Sealed + Sized {
// Provided method
fn push_to_builder(self, _: &mut Builder) { ... }
}Expand description
Types that implement the Pushable trait can be written into a Flexbuffer.
All Rust’s standard numbers, u8, u16, u32, u64, i8, i16, i32, i64, f32, f64,
can all be pushed. They are FlexBufferType::{UInt, Int, Float}.
Flexbuffers chooses the smallest width that can represent the given number.
Strings can pe pushed, they become FlexBufferType::String and are stored
with both a length and null terminator.
-
For convenience and speed push typed vectors using rust arrays and slices. Doing so will immediately serialize the data, skipping the
Builder’s internal cache. -
Pushable cannot not be implemented by any downstream crates.
Provided Methods§
fn push_to_builder(self, _: &mut Builder)
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.