Trait RelaxedFollowTrait

Source
pub trait RelaxedFollowTrait {
    type Inner<'a>: Follow<'a>;

    // Provided method
    unsafe fn follow(
        buf: &[u8],
        loc: usize,
    ) -> <<Self as RelaxedFollowTrait>::Inner<'_> as Follow<'_>>::Inner { ... }
}
Expand description

This trait allows a .follow() method that returns a FlatBuffer with the lifetime of the provided byte slice.

§Example trait implementation

use flatbuffers_owned::RelaxedFollowTrait;

impl RelaxedFollowTrait for MyFlatBuffer<'_> {
   type Inner<'a> = MyFlatBuffer<'a>;
}

Required Associated Types§

Source

type Inner<'a>: Follow<'a>

Provided Methods§

Source

unsafe fn follow( buf: &[u8], loc: usize, ) -> <<Self as RelaxedFollowTrait>::Inner<'_> as Follow<'_>>::Inner

§Safety

This function lacks verification. This method could yield a FlatBuffer with undefined behavior on field reads when corrupted FlatBuffer bytes are passed.

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.

Implementors§