Struct Items
pub struct Items<T> {
len: usize,
bytes: Bytes,
item: PhantomData<fn() -> T>,
}Expand description
A decoded array that shares the message buffer.
The elements are checked when the array is decoded and decoded again on
every iteration. This avoids allocating a collection. Read a
length-prefixed array with Prefixed.
Fields§
§len: usize§bytes: Bytes§item: PhantomData<fn() -> T>Implementations§
§impl<T: Decode> Items<T>
impl<T: Decode> Items<T>
pub fn decode_len(len: usize, reader: &mut Reader) -> Result<Self, ValueError>
pub fn decode_len(len: usize, reader: &mut Reader) -> Result<Self, ValueError>
Reads len elements.
§Errors
Returns an error if an element is invalid, or
ValueError::OutOfRange if an element takes up no bytes.
Trait Implementations§
impl<T> Eq for Items<T>
§impl<T: Decode> IntoIterator for Items<T>
impl<T: Decode> IntoIterator for Items<T>
§impl<T: Decode> IntoIterator for &Items<T>
impl<T: Decode> IntoIterator for &Items<T>
Auto Trait Implementations§
impl<T> !Freeze for Items<T>
impl<T> RefUnwindSafe for Items<T>
impl<T> Send for Items<T>
impl<T> Sync for Items<T>
impl<T> Unpin for Items<T>
impl<T> UnsafeUnpin for Items<T>
impl<T> UnwindSafe for Items<T>
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