Trait flatbuffers::Follow

source ·
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§

source

unsafe fn follow(buf: &'buf [u8], loc: usize) -> Self::Inner

§Safety

buf[loc..] must contain a valid value of Self and anything it transitively refers to by offset must also be valid

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<'a> Follow<'a> for &'a str

§

type Inner = &'a str

source§

unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner

source§

impl<'a> Follow<'a> for &'a [u8]

§

type Inner = &'a [u8]

source§

unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner

source§

impl<'a> Follow<'a> for bool

§

type Inner = bool

source§

unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner

source§

impl<'a> Follow<'a> for f32

§

type Inner = f32

source§

unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner

source§

impl<'a> Follow<'a> for f64

§

type Inner = f64

source§

unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner

source§

impl<'a> Follow<'a> for i8

§

type Inner = i8

source§

unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner

source§

impl<'a> Follow<'a> for i16

§

type Inner = i16

source§

unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner

source§

impl<'a> Follow<'a> for i32

§

type Inner = i32

source§

unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner

source§

impl<'a> Follow<'a> for i64

§

type Inner = i64

source§

unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner

source§

impl<'a> Follow<'a> for u8

§

type Inner = u8

source§

unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner

source§

impl<'a> Follow<'a> for u16

§

type Inner = u16

source§

unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner

source§

impl<'a> Follow<'a> for u32

§

type Inner = u32

source§

unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner

source§

impl<'a> Follow<'a> for u64

§

type Inner = u64

source§

unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner

Implementors§

source§

impl<'a> Follow<'a> for FileIdentifier

§

type Inner = &'a [u8]

source§

impl<'a> Follow<'a> for Table<'a>

§

type Inner = Table<'a>

source§

impl<'a, T: Follow<'a> + 'a> Follow<'a> for SkipFileIdentifier<T>

§

type Inner = <T as Follow<'a>>::Inner

source§

impl<'a, T: Follow<'a> + 'a> Follow<'a> for SkipRootOffset<T>

§

type Inner = <T as Follow<'a>>::Inner

source§

impl<'a, T: Follow<'a> + 'a> Follow<'a> for SkipSizePrefix<T>

§

type Inner = <T as Follow<'a>>::Inner

source§

impl<'a, T: Follow<'a> + 'a> Follow<'a> for Vector<'a, T>

Implement Follow for all possible Vectors that have Follow-able elements.

§

type Inner = Vector<'a, T>

source§

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.

§

type Inner = Array<'a, T, N>

source§

impl<'a, T: Follow<'a>> Follow<'a> for BackwardsSOffset<T>

§

type Inner = <T as Follow<'a>>::Inner

source§

impl<'a, T: Follow<'a>> Follow<'a> for FollowStart<T>

§

type Inner = <T as Follow<'a>>::Inner

source§

impl<'a, T: Follow<'a>> Follow<'a> for ForwardsUOffset<T>

§

type Inner = <T as Follow<'a>>::Inner

source§

impl<'a, T: Follow<'a>> Follow<'a> for ForwardsVOffset<T>

§

type Inner = <T as Follow<'a>>::Inner