Struct flatbuffers::Verifier

source ·
pub struct Verifier<'opts, 'buf> { /* private fields */ }
Expand description

Carries the verification state. Should not be reused between tables.

Implementations§

source§

impl<'opts, 'buf> Verifier<'opts, 'buf>

source

pub fn new(opts: &'opts VerifierOptions, buffer: &'buf [u8]) -> Self

source

pub fn reset(&mut self)

Resets verifier internal state.

source

pub fn in_buffer<T>(&mut self, pos: usize) -> Result<(), InvalidFlatbuffer>

Check that there really is a T in there.

source

pub fn visit_table<'ver>( &'ver mut self, table_pos: usize ) -> Result<TableVerifier<'ver, 'opts, 'buf>, InvalidFlatbuffer>

source

pub fn verify_union_variant<T: Verifiable>( &mut self, variant: &'static str, position: usize ) -> Result<(), InvalidFlatbuffer>

Runs the union variant’s type’s verifier assuming the variant is at the given position, tracing the error.

Trait Implementations§

source§

impl<'opts, 'buf> Debug for Verifier<'opts, 'buf>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'opts, 'buf> Freeze for Verifier<'opts, 'buf>

§

impl<'opts, 'buf> RefUnwindSafe for Verifier<'opts, 'buf>

§

impl<'opts, 'buf> Send for Verifier<'opts, 'buf>

§

impl<'opts, 'buf> Sync for Verifier<'opts, 'buf>

§

impl<'opts, 'buf> Unpin for Verifier<'opts, 'buf>

§

impl<'opts, 'buf> UnwindSafe for Verifier<'opts, 'buf>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.