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
initializedChunk
s - 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§
Sourcefn take_chunks_raw(
&mut self,
count: usize,
) -> Result<NonNull<Chunk>, DecodeError>
fn take_chunks_raw( &mut self, count: usize, ) -> Result<NonNull<Chunk>, DecodeError>
Takes a slice of Chunk
s from the decoder, returning a pointer to them.
Returns Err
if the decoder doesn’t have enough chunks left.
Sourcefn finish(&mut self) -> Result<(), DecodeError>
fn finish(&mut self) -> Result<(), DecodeError>
Finishes decoding.
Returns Err
if the decoder did not finish successfully.