Trait Decoder

Source
pub unsafe trait Decoder: InternalHandleDecoder {
    // Required methods
    fn take_chunks_raw(
        &mut self,
        count: usize,
    ) -> Result<NonNull<Chunk>, DecodeError>;
    fn finish(&mut self) -> Result<(), DecodeError>;
}
Expand description

A decoder for FIDL messages.

§Safety

Pointers returned from take_chunks must:

  • Point to count initialized Chunks
  • Be valid for reads and writes
  • Remain valid until the decoder is dropped

The decoder may be moved without invalidating the returned pointers.

Required Methods§

Source

fn take_chunks_raw( &mut self, count: usize, ) -> Result<NonNull<Chunk>, DecodeError>

Takes a slice of Chunks from the decoder, returning a pointer to them.

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 Decoder for &mut [Chunk]

Implementors§