Trait flatbuffers::Follow[][src]

pub trait Follow<'buf> {
    type Inner;
    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.

Associated Types

Required methods

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

Implementations on Foreign Types

impl<'a> Follow<'a> for bool[src]

type Inner = bool

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

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

type Inner = u8

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

impl<'a> Follow<'a> for u16[src]

type Inner = u16

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

impl<'a> Follow<'a> for u32[src]

type Inner = u32

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

impl<'a> Follow<'a> for u64[src]

type Inner = u64

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

impl<'a> Follow<'a> for i8[src]

type Inner = i8

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

impl<'a> Follow<'a> for i16[src]

type Inner = i16

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

impl<'a> Follow<'a> for i32[src]

type Inner = i32

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

impl<'a> Follow<'a> for i64[src]

type Inner = i64

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

impl<'a> Follow<'a> for f32[src]

type Inner = f32

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

impl<'a> Follow<'a> for f64[src]

type Inner = f64

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

impl<'a> Follow<'a> for &'a str[src]

type Inner = &'a str

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

impl<'a, T: EndianScalar> Follow<'a> for &'a [T][src]

Implement direct slice access if the host is little-endian.

type Inner = &'a [T]

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

Implementors

impl<'a> Follow<'a> for FileIdentifier[src]

type Inner = &'a [u8]

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

impl<'a> Follow<'a> for Table<'a>[src]

type Inner = Table<'a>

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

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

type Inner = T::Inner

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

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

type Inner = T::Inner

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

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

type Inner = T::Inner

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

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

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

type Inner = Vector<'a, T>

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

impl<'a, T: Follow<'a> + 'a, const N: usize> Follow<'a> for Array<'a, T, N>[src]

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

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

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

impl<'a, T: Follow<'a>> Follow<'a> for BackwardsSOffset<T>[src]

type Inner = T::Inner

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

impl<'a, T: Follow<'a>> Follow<'a> for FollowStart<T>[src]

type Inner = T::Inner

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

impl<'a, T: Follow<'a>> Follow<'a> for ForwardsUOffset<T>[src]

type Inner = T::Inner

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

impl<'a, T: Follow<'a>> Follow<'a> for ForwardsVOffset<T>[src]

type Inner = T::Inner

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