Function xdr_codec::pack_array [] [src]

pub fn pack_array<Out, T>(val: &[T],
                          sz: usize,
                          out: &mut Out,
                          defl: Option<&T>)
                          -> Result<usize> where Out: Write, T: Pack<Out>

Pack a fixed-size array.

As the size is fixed, it doesn't need to be encoded. sz is in units of array elements. If the val is too large, it is truncated; it is too small, then the array is padded out with default values (if provided). If the array is too small and there's no pad/default value, then it fails with Error::InvalidLen.