pub fn encode_to_slice<T, C>(t: T, slice: &mut [u8], config: C) -> Result<usize, EncodeError>
where
    T: Serialize,
    C: Config,
{
    let mut encoder =
        crate::enc::EncoderImpl::new(crate::enc::write::SliceWriter::new(slice), config);
    let serializer = SerdeEncoder { enc: &mut encoder };
    t.serialize(serializer)?;
    Ok(encoder.into_writer().bytes_written())
}
/// Encode a `serde` `Serialize` type into a given byte slice with the bincode algorithm
Encode a `serde` `Serialize` type into a given byte slice with the bincode algorithm
Encode a ` serde ` ` Serialize ` type into a given byte slice with the bincode algorithm
pub fn encode_to_slice<T, C>(t: T, slice: &mut [u8], config: C) -> Result<usize, EncodeError>
where
    T: Serialize,
    C: Config,
{
    let mut encoder =
        crate::enc::EncoderImpl::new(crate::enc::write::SliceWriter::new(slice), config);
    let serializer = SerdeEncoder { enc: &mut encoder };
    t.serialize(serializer)?;
    Ok(encoder.into_writer().bytes_written())
}
pub fn encode_to_slice < T , C > ( t : T , slice : & mut [ u8 ] , config : C ) -> Result < usize , EncodeError > where T : Serialize , C : Config , { let mut encoder = crate :: enc :: EncoderImpl :: new ( crate :: enc :: write :: SliceWriter :: new ( slice ) , config ) ; let serializer = SerdeEncoder { enc : & mut encoder } ; t . serialize ( serializer ) ? ; Ok ( encoder . into_writer ( ) . bytes_written ( ) ) }
Encode a `serde` `Serialize` type into a given byte slice with the bincode algorithm
Encode a ` serde ` ` Serialize ` type into a given byte slice with the bincode algorithm
t
T
slice
&mut [u8]
config
C