pub struct Array;
Expand description
Namespace for functions that perform encoding of array contents.
This is similar to the Vector
encoding except that no length information is
written as part of the encoding, so length must be statically known or obtained from
other parts of the input stream.
Implementations§
Source§impl Array
impl Array
Sourcepub fn read<R: Read, E, F>(reader: R, count: usize, func: F) -> Result<Vec<E>>
pub fn read<R: Read, E, F>(reader: R, count: usize, func: F) -> Result<Vec<E>>
Reads count
elements from a stream into a vector, assuming the encoding written by
Array::write
, using the provided function to decode each element.
Sourcepub fn read_collected<R: Read, E, F, O: FromIterator<E>>(
reader: R,
count: usize,
func: F,
) -> Result<O>
pub fn read_collected<R: Read, E, F, O: FromIterator<E>>( reader: R, count: usize, func: F, ) -> Result<O>
Reads count
elements into a collection, assuming the encoding written by
Array::write
, using the provided function to decode each element.
Sourcepub fn read_collected_mut<R: Read, E, F, O: FromIterator<E>>(
reader: R,
count: usize,
func: F,
) -> Result<O>
pub fn read_collected_mut<R: Read, E, F, O: FromIterator<E>>( reader: R, count: usize, func: F, ) -> Result<O>
Reads count
elements into a collection, assuming the encoding written by
Array::write
, using the provided function to decode each element.
Auto Trait Implementations§
impl Freeze for Array
impl RefUnwindSafe for Array
impl Send for Array
impl Sync for Array
impl Unpin for Array
impl UnwindSafe for Array
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more