Skip to main content

ExternalValueSource

Trait ExternalValueSource 

Source
pub trait ExternalValueSource {
    // Required methods
    fn take_bytes(&mut self, length: usize) -> Result<Vec<u8>>;
    fn take_chunks(&mut self, length: usize) -> Result<Vec<Bytes>>;
    fn finish(&mut self) -> Result<()>;
}
Expand description

Supplies complete external byte values while a FlatBuffer is decoded.

RecvChain copies values out of shared memory. Segments retains existing chunk owners.

Implementations must validate length against available input and the resource budget before allocating.

Required Methods§

Source

fn take_bytes(&mut self, length: usize) -> Result<Vec<u8>>

Take the next external value as contiguous bytes.

Source

fn take_chunks(&mut self, length: usize) -> Result<Vec<Bytes>>

Take the next external value as owned byte chunks.

Source

fn finish(&mut self) -> Result<()>

Finish decoding and reject any unused external values.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl ExternalValueSource for Segments

Source§

impl<M: MemOps> ExternalValueSource for RecvChain<M>

Copies values so later shared-memory writes cannot change decoded arguments.