pub trait Follow<'buf> {
type Inner;
// Required method
unsafe fn follow(buf: &'buf [u8], loc: usize) -> Self::Inner;
}
Expand description
Follow is a trait that allows us to access FlatBuffers in a declarative, type safe, and fast way. They compile down to almost no code (after optimizations). Conceptually, Follow lifts the offset-based access patterns of FlatBuffers data into the type system. This trait is used pervasively at read time, to access tables, vtables, vectors, strings, and all other data. At this time, Follow is not utilized much on the write path.
Writing a new Follow implementation primarily involves deciding whether you want to return data (of the type Self::Inner) or do you want to continue traversing the FlatBuffer.
Required Associated Types§
Required Methods§
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.
Implementations on Foreign Types§
Implementors§
Source§impl<'a, T: Follow<'a> + 'a> Follow<'a> for SkipFileIdentifier<T>
impl<'a, T: Follow<'a> + 'a> Follow<'a> for SkipFileIdentifier<T>
Source§impl<'a, T: Follow<'a> + 'a> Follow<'a> for SkipRootOffset<T>
impl<'a, T: Follow<'a> + 'a> Follow<'a> for SkipRootOffset<T>
Source§impl<'a, T: Follow<'a> + 'a> Follow<'a> for SkipSizePrefix<T>
impl<'a, T: Follow<'a> + 'a> Follow<'a> for SkipSizePrefix<T>
Source§impl<'a, T: Follow<'a> + 'a> Follow<'a> for Vector<'a, T>
impl<'a, T: Follow<'a> + 'a> Follow<'a> for Vector<'a, T>
Implement Follow for all possible Vectors that have Follow-able elements.
Source§impl<'a, T: Follow<'a> + 'a, const N: usize> Follow<'a> for Array<'a, T, N>
impl<'a, T: Follow<'a> + 'a, const N: usize> Follow<'a> for Array<'a, T, N>
Implement Follow for all possible Arrays that have Follow-able elements.