pub fn serialize<N>(nl: &N, align: bool) -> Result<Vec<u8>, SerError>
where
    N: Nl,
{
    let len = if align { nl.asize() } else { nl.size() };
    let mut vec = vec![0; len];
    nl.serialize(vec.as_mut_slice())?;
    Ok(vec)
}
/// Convenience method for allocating a buffer for serialization.
Convenience method for allocating a buffer for serialization.
Convenience method for allocating a buffer for serialization .
pub fn serialize<N>(nl: &N, align: bool) -> Result<Vec<u8>, SerError>
where
    N: Nl,
{
    let len = if align { nl.asize() } else { nl.size() };
    let mut vec = vec![0; len];
    nl.serialize(vec.as_mut_slice())?;
    Ok(vec)
}
pub fn serialize < N > ( nl : & N , align : bool ) -> Result < Vec < u8 > , SerError > where N : Nl , { let len = if align { nl . asize ( ) } else { nl . size ( ) } ; let mut vec = vec ! [ 0 len ] ; nl . serialize ( vec . as_mut_slice ( ) ) ? ; Ok ( vec ) }
Convenience method for allocating a buffer for serialization.
Convenience method for allocating a buffer for serialization .
nl
&N
align
bool
nl
&N
align
bool