pub fn decode_with_context<T: Decodable>(
        context: &Context,
        buf: &'a [u8],
        handles: &'a mut [Handle],
        value: &mut T,
    ) -> Result<()> {
        let inline_size = T::inline_size(context);
        let out_of_line_offset = round_up_to_align(inline_size, 8);
        if buf.len() < out_of_line_offset {
            return Err(Error::OutOfRange);
        }

        let (buf, out_of_line_buf) = buf.split_at(out_of_line_offset);

        let mut decoder = Decoder {
            remaining_depth: MAX_RECURSION,
            buf,
            initial_buf_len: buf.len(),
            out_of_line_buf,
            initial_out_of_line_buf_len: out_of_line_buf.len(),
            handles,
            context,
        };
        value.decode(&mut decoder)?;
        if decoder.out_of_line_buf.len() != 0 {
            return Err(Error::ExtraBytes);
        }
        if decoder.handles.len() != 0 {
            return Err(Error::ExtraHandles);
        }
        debug_assert!(
            decoder.buf.len() == out_of_line_offset - inline_size,
            "Inline part of the buffer was not completely consumed. Most likely, this indicates a \
             bug in the FIDL decoders.\n\
             Inline buffer size: {}\n\
             Type size: {}\n\
             Consumed: {}\n\
             Leftover size: {}\n\
             Buffer: {:X?}",
            out_of_line_offset,
            inline_size,
            out_of_line_offset - decoder.buf.len(),
            decoder.buf.len(),
            decoder.buf,
        );
        for i in 0..decoder.buf.len() {
            if decoder.buf[i] != 0 {
                return Err(Error::NonZeroPadding {
                    padding_start: inline_size,
                    non_zero_pos: inline_size + i,
                });
            }
        }
        Ok(())
    }
/// FIDL2-decodes a value of type `T` from the provided data and handle
/// buffers, using the specified context.
///
/// WARNING: Do not call this directly unless you know what you're doing.
/// FIDL uses `Context` to coordinate soft migrations, so improper uses of
/// this function could result in ABI breakage.
FIDL2-decodes a value of type `T` from the provided data and handle
buffers, using the specified context.

Do not call this directly unless you know what you're doing.
FIDL uses `Context` to coordinate soft migrations, so improper uses of
this function could result in ABI breakage.
FIDL2 - decodes a value of type ` T ` from the provided data and handle buffers using the specified context . Do not call this directly unless you know what you ' re doing . FIDL uses ` Context ` to coordinate soft migrations so improper uses of this function could result in ABI breakage .
pub fn decode_with_context<T: Decodable>(
        context: &Context,
        buf: &'a [u8],
        handles: &'a mut [Handle],
        value: &mut T,
    ) -> Result<()> {
        let inline_size = T::inline_size(context);
        let out_of_line_offset = round_up_to_align(inline_size, 8);
        if buf.len() < out_of_line_offset {
            return Err(Error::OutOfRange);
        }
        let (buf, out_of_line_buf) = buf.split_at(out_of_line_offset);
        let mut decoder = Decoder {
            remaining_depth: MAX_RECURSION,
            buf,
            initial_buf_len: buf.len(),
            out_of_line_buf,
            initial_out_of_line_buf_len: out_of_line_buf.len(),
            handles,
            context,
        };
        value.decode(&mut decoder)?;
        if decoder.out_of_line_buf.len() != 0 {
            return Err(Error::ExtraBytes);
        }
        if decoder.handles.len() != 0 {
            return Err(Error::ExtraHandles);
        }
        debug_assert!(
            decoder.buf.len() == out_of_line_offset - inline_size,
            "Inline part of the buffer was not completely consumed. Most likely, this indicates a \
             bug in the FIDL decoders.\n\
             Inline buffer size: {}\n\
             Type size: {}\n\
             Consumed: {}\n\
             Leftover size: {}\n\
             Buffer: {:X?}",
            out_of_line_offset,
            inline_size,
            out_of_line_offset - decoder.buf.len(),
            decoder.buf.len(),
            decoder.buf,
        );
        for i in 0..decoder.buf.len() {
            if decoder.buf[i] != 0 {
                return Err(Error::NonZeroPadding {
                    padding_start: inline_size,
                    non_zero_pos: inline_size + i,
                });
            }
        }
        Ok(())
    }
pub fn decode_with_context < T : Decodable > ( context : & Context , buf : & ' a [ u8 ] , handles : & ' a mut [ Handle ] , value : & mut T , ) -> Result < ( ) > { let inline_size = T :: inline_size ( context ) ; let out_of_line_offset = round_up_to_align ( inline_size , 8 ) ; if buf . len ( ) < out_of_line_offset { return Err ( Error :: OutOfRange ) ; } let ( buf , out_of_line_buf ) = buf . split_at ( out_of_line_offset ) ; let mut decoder = Decoder { remaining_depth : MAX_RECURSION , buf , initial_buf_len : buf . len ( ) , out_of_line_buf , initial_out_of_line_buf_len : out_of_line_buf . len ( ) , handles , context , } ; value . decode ( & mut decoder ) ? ; if decoder . out_of_line_buf . len ( ) != 0 { return Err ( Error :: ExtraBytes ) ; } if decoder . handles . len ( ) != 0 { return Err ( Error :: ExtraHandles ) ; } debug_assert ! ( decoder buf len ( ) out_of_line_offset inline_size " \
 \n \
 \n \
 \n \
 \n \
 \n \
 " out_of_line_offset inline_size out_of_line_offset decoder buf len ( ) decoder buf len ( ) decoder buf ) ; for i in 0 .. decoder . buf . len ( ) { if decoder . buf [ i ] != 0 { return Err ( Error :: NonZeroPadding { padding_start : inline_size , non_zero_pos : inline_size + i , } ) ; } } Ok ( ( ) ) }
FIDL2-decodes a value of type `T` from the provided data and handle
buffers, using the specified context.
FIDL2 - decodes a value of type ` T ` from the provided data and handle buffers using the specified context .
context
&Context
buf
&'a [u8]
handles
&'a mut [Handle]
value
&mut T
context
&Context
buf
&'a [u8]
handles
&'a mut [Handle]
value
&mut T