pub struct Vec<S: Integer, T: Parcel> {
pub elements: Vec<T>,
/* private fields */
}
Expand description
A newtype wrapping Vec<T>
but with a custom length prefix type.
Fields§
§elements: Vec<T>
The inner Vec<T>
.
Implementations§
Trait Implementations§
Source§impl<S: Integer, T: Parcel> Parcel for Vec<S, T>
impl<S: Integer, T: Parcel> Parcel for Vec<S, T>
Source§fn read_field(
read: &mut dyn Read,
settings: &Settings,
hints: &mut Hints,
) -> Result<Self, Error>
fn read_field( read: &mut dyn Read, settings: &Settings, hints: &mut Hints, ) -> Result<Self, Error>
Reads a value from a stream. Read more
Source§fn write_field(
&self,
write: &mut dyn Write,
settings: &Settings,
hints: &mut Hints,
) -> Result<(), Error>
fn write_field( &self, write: &mut dyn Write, settings: &Settings, hints: &mut Hints, ) -> Result<(), Error>
Writes a value to a stream.
Source§fn read(read: &mut dyn Read, settings: &Settings) -> Result<Self, Error>
fn read(read: &mut dyn Read, settings: &Settings) -> Result<Self, Error>
Reads a new item with a fresh set of hints. Read more
Source§fn write(&self, write: &mut dyn Write, settings: &Settings) -> Result<(), Error>
fn write(&self, write: &mut dyn Write, settings: &Settings) -> Result<(), Error>
Writes a value to a stream.
Source§fn into_stream(self, settings: &Settings) -> Result<Cursor<Vec<u8>>, Error>
fn into_stream(self, settings: &Settings) -> Result<Cursor<Vec<u8>>, Error>
Convers the value into a byte stream that implements
std::io::Read
.Source§fn from_raw_bytes(bytes: &[u8], settings: &Settings) -> Result<Self, Error>
fn from_raw_bytes(bytes: &[u8], settings: &Settings) -> Result<Self, Error>
Parses a new value from its raw byte representation. Read more
Source§fn field_from_raw_bytes(
bytes: &[u8],
settings: &Settings,
hints: &mut Hints,
) -> Result<Self, Error>
fn field_from_raw_bytes( bytes: &[u8], settings: &Settings, hints: &mut Hints, ) -> Result<Self, Error>
Parses a new value from its raw byte representation. Read more
Source§fn raw_bytes(&self, settings: &Settings) -> Result<Vec<u8>, Error>
fn raw_bytes(&self, settings: &Settings) -> Result<Vec<u8>, Error>
Gets the raw byte representation of the value.
impl<S: Integer, T: Parcel> StructuralPartialEq for Vec<S, T>
Auto Trait Implementations§
impl<S, T> Freeze for Vec<S, T>
impl<S, T> RefUnwindSafe for Vec<S, T>where
S: RefUnwindSafe,
T: RefUnwindSafe,
impl<S, T> Send for Vec<S, T>
impl<S, T> Sync for Vec<S, T>
impl<S, T> Unpin for Vec<S, T>
impl<S, T> UnwindSafe for Vec<S, T>where
S: UnwindSafe,
T: UnwindSafe,
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