fidl_next::decoder

Trait Decoder

Source
pub trait Decoder<'buf>: InternalHandleDecoder {
    // Required methods
    fn take_chunks(
        &mut self,
        count: usize,
    ) -> Result<&'buf mut [Chunk], DecodeError>;
    fn finish(&mut self) -> Result<(), DecodeError>;
}
Expand description

A decoder for FIDL messages.

Required Methods§

Source

fn take_chunks( &mut self, count: usize, ) -> Result<&'buf mut [Chunk], DecodeError>

Takes a slice of Chunks from the decoder.

Returns Err if the decoder doesn’t have enough chunks left.

Source

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

Finishes decoding.

Returns Err if the decoder did not finish successfully.

Implementations on Foreign Types§

Source§

impl<'buf> Decoder<'buf> for &'buf mut [Chunk]

Source§

fn take_chunks( &mut self, count: usize, ) -> Result<&'buf mut [Chunk], DecodeError>

Source§

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

Source§

impl<'buf, T: Decoder<'buf>> Decoder<'buf> for &mut T

Source§

fn take_chunks( &mut self, count: usize, ) -> Result<&'buf mut [Chunk], DecodeError>

Source§

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

Implementors§

Source§

impl<'buf> Decoder<'buf> for &'buf mut fidl_next::fuchsia::channel::RecvBuffer

Source§

impl<'buf> Decoder<'buf> for &'buf mut fidl_next::protocol::mpsc::RecvBuffer