Enum flexbuffers::FlexBufferType [−][src]
#[repr(u8)] pub enum FlexBufferType {}Show variants
Null, Int, UInt, Float, Bool, Key, String, IndirectInt, IndirectUInt, IndirectFloat, Map, Vector, VectorInt, VectorUInt, VectorFloat, VectorKey, VectorString, VectorBool, VectorInt2, VectorUInt2, VectorFloat2, VectorInt3, VectorUInt3, VectorFloat3, VectorInt4, VectorUInt4, VectorFloat4, Blob,
Expand description
Represents all the valid types in a flexbuffer.
Flexbuffers supports heterogenous maps, heterogenous vectors, typed vectors, and fixed length typed vectors for some lengths and types. Rust types are converted into Flexbuffers via the Pushable trait.
For exact details see the internals document
Notes:
-
In the binary format, Each element of a
Map
or (heterogenous)Vector
is stored with a byte describing its FlexBufferType and BitWidth. -
Typed vectors do not store this extra type information and fixed length typed vectors do not store length. Whether a vector is stored as a typed vector or fixed length typed vector is determined dymaically from the given data.
-
Indirect numbers are stored as an offset instead of inline. Using indirect numbers instead of their inline counterparts in maps and typed vectors can reduce the minimum element width and therefore bytes used.
Variants
Expand description
Nulls are represented with ()
in Rust.
Expand description
Variable width signed integer: i8, i16, i32, i64
Expand description
Variable width unsigned integer: u8, u16, u32, u64
Expand description
Variable width floating point: f32, f64
Expand description
Null termintated, utf8 string. Typically used with Map
s.
Expand description
Stored with a unsigned integer length, then UTF-8 bytes, and an extra null terminator that is not counted with the length.
Expand description
An Int, stored by offset rather than inline. Indirect types can keep the bitwidth of a vector or map small when the inline value would have increased the bitwidth.
Expand description
A UInt, stored by offset rather than inline. Indirect types can keep the bitwidth of a vector or map small when the inline value would have increased the bitwidth.
Expand description
A Float, stored by offset rather than inline. Indirect types can keep the bitwidth of a vector or map small when the inline value would have increased the bitwidth.
Expand description
Maps are like Vectors except elements are associated with, and sorted by, keys.
Expand description
Heterogenous Vector (stored with a type table).
Expand description
Homogenous Vector of Ints.
Expand description
Homogenous Vector of UInts.
Expand description
Homogenous Vector of Floats.
Expand description
Homogenous Vector of Keys.
Please use Vector or VectorKey instead. See https://github.com/google/flatbuffers/issues/5627
Expand description
Homogenous Vector of Strings.
Expand description
Since the elements of a vector use the same BitWidth
as the length,
Blob is more efficient for >255 element boolean vectors.
Expand description
Homogenous vector of two Ints
Expand description
Homogenous vector of two UInts
Expand description
Homogenous vector of two Floats
Expand description
Homogenous vector of three Ints
Expand description
Homogenous vector of three UInts
Expand description
Homogenous vector of three Floats
Expand description
Homogenous vector of four Ints
Expand description
Homogenous vector of four UInts
Expand description
Homogenous vector of four Floats
Expand description
An array of bytes. Stored with a variable width length.
Implementations
impl FlexBufferType
[src]
impl FlexBufferType
[src]pub fn is_reference(self) -> bool
[src]
pub fn is_reference(self) -> bool
[src]Returns true for flexbuffer types that are stored by offset.
pub fn is_vector(self) -> bool
[src]
pub fn is_vector(self) -> bool
[src]Returns true if called on a map, vector, typed vector, or fixed length typed vector.
pub fn has_length_slot(self) -> bool
[src]
pub fn has_length_slot(self) -> bool
[src]True iff the binary format stores the length. This applies to Blob, String, Maps, and Vectors of variable length.
pub fn is_fixed_length_vector(self) -> bool
[src]
pub fn is_fixed_length_vector(self) -> bool
[src]Returns true if called on a fixed length typed vector.
pub fn typed_vector_type(self) -> Option<FlexBufferType>
[src]
pub fn typed_vector_type(self) -> Option<FlexBufferType>
[src]If called on a fixed type vector, returns the type of the elements.
pub fn fixed_length_vector_length(self) -> Option<usize>
[src]
pub fn fixed_length_vector_length(self) -> Option<usize>
[src]Return the length of the fixed length vector or None.
pub fn is_heterogenous(self) -> bool
[src]
pub fn is_heterogenous(self) -> bool
[src]Returns true if self is a Map or Vector. Typed vectors are not heterogenous.
pub fn to_direct(self) -> Option<Self>
[src]
pub fn to_direct(self) -> Option<Self>
[src]If self
is an indirect scalar, remap it to the scalar. Otherwise do nothing.
pub fn is_null(self) -> bool
[src]
pub fn is_int(self) -> bool
[src]
pub fn is_uint(self) -> bool
[src]
pub fn is_float(self) -> bool
[src]
pub fn is_bool(self) -> bool
[src]
pub fn is_key(self) -> bool
[src]
pub fn is_string(self) -> bool
[src]
pub fn is_indirect_int(self) -> bool
[src]
pub fn is_indirect_uint(self) -> bool
[src]
pub fn is_indirect_float(self) -> bool
[src]
pub fn is_map(self) -> bool
[src]
pub fn is_heterogenous_vector(self) -> bool
[src]
pub fn is_vector_int(self) -> bool
[src]
pub fn is_vector_uint(self) -> bool
[src]
pub fn is_vector_float(self) -> bool
[src]
pub fn is_vector_key(self) -> bool
[src]
pub fn is_vector_string(self) -> bool
[src]
pub fn is_vector_bool(self) -> bool
[src]
pub fn is_vector_int2(self) -> bool
[src]
pub fn is_vector_uint2(self) -> bool
[src]
pub fn is_vector_float2(self) -> bool
[src]
pub fn is_vector_int3(self) -> bool
[src]
pub fn is_vector_uint3(self) -> bool
[src]
pub fn is_vector_float3(self) -> bool
[src]
pub fn is_vector_int4(self) -> bool
[src]
pub fn is_vector_uint4(self) -> bool
[src]
pub fn is_vector_float4(self) -> bool
[src]
pub fn is_blob(self) -> bool
[src]
Trait Implementations
impl Clone for FlexBufferType
[src]
impl Clone for FlexBufferType
[src]fn clone(&self) -> FlexBufferType
[src]
fn clone(&self) -> FlexBufferType
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Debug for FlexBufferType
[src]
impl Debug for FlexBufferType
[src]impl Default for FlexBufferType
[src]
impl Default for FlexBufferType
[src]impl<'de> Deserialize<'de> for FlexBufferType
[src]
impl<'de> Deserialize<'de> for FlexBufferType
[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
impl PartialEq<FlexBufferType> for FlexBufferType
[src]
impl PartialEq<FlexBufferType> for FlexBufferType
[src]impl Serialize for FlexBufferType
[src]
impl Serialize for FlexBufferType
[src]impl TryFrom<u8> for FlexBufferType
[src]
impl TryFrom<u8> for FlexBufferType
[src]type Error = TryFromPrimitiveError<Self>
type Error = TryFromPrimitiveError<Self>
The type returned in the event of a conversion error.
fn try_from(number: u8) -> Result<Self, TryFromPrimitiveError<Self>>
[src]
fn try_from(number: u8) -> Result<Self, TryFromPrimitiveError<Self>>
[src]Performs the conversion.
impl TryFromPrimitive for FlexBufferType
[src]
impl TryFromPrimitive for FlexBufferType
[src]type Primitive = u8
const NAME: &'static str
[src]
fn try_from_primitive(
number: Self::Primitive
) -> Result<Self, TryFromPrimitiveError<Self>>
[src]
number: Self::Primitive
) -> Result<Self, TryFromPrimitiveError<Self>>
impl Copy for FlexBufferType
[src]
impl Eq for FlexBufferType
[src]
impl StructuralEq for FlexBufferType
[src]
impl StructuralPartialEq for FlexBufferType
[src]
Auto Trait Implementations
impl RefUnwindSafe for FlexBufferType
impl Send for FlexBufferType
impl Sync for FlexBufferType
impl Unpin for FlexBufferType
impl UnwindSafe for FlexBufferType
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,