[][src]Struct protocol::types::Vec

pub struct Vec<S: Integer, T: Parcel> {
    pub elements: Vec<T>,
    // some fields omitted
}

A newtype wrapping Vec<T> but with a custom length prefix type.

Fields

elements: Vec<T>

The inner Vec<T>.

Methods

impl<S: Integer, T: Parcel> Vec<S, T>[src]

pub fn new(elements: Vec<T>) -> Self[src]

Creates a new Vec from a list of elements.

Trait Implementations

impl<S: Integer, T: Parcel> Parcel for Vec<S, T>[src]

fn read(read: &mut dyn Read, settings: &Settings) -> Result<Self, Error>[src]

Reads a new item with a fresh set of hints. Read more

fn write(&self, write: &mut dyn Write, settings: &Settings) -> Result<(), Error>[src]

Writes a value to a stream.

fn into_stream(self, settings: &Settings) -> Result<Cursor<Vec<u8>>, Error>[src]

Convers the value into a byte stream that implements std::io::Read.

fn from_raw_bytes(bytes: &[u8], settings: &Settings) -> Result<Self, Error>[src]

Parses a new value from its raw byte representation. Read more

fn field_from_raw_bytes(
    bytes: &[u8],
    settings: &Settings,
    hints: &mut Hints
) -> Result<Self, Error>
[src]

Parses a new value from its raw byte representation. Read more

fn raw_bytes(&self, settings: &Settings) -> Result<Vec<u8>, Error>[src]

Gets the raw byte representation of the value.

fn raw_bytes_field(
    &self,
    settings: &Settings,
    hints: &mut Hints
) -> Result<Vec<u8>, Error>
[src]

Gets the raw bytes of this type as a field of a larger type.

fn type_name(&self) -> &'static str[src]

Gets the name of the type; Parcel::TYPE_NAME.

impl<S: PartialEq + Integer, T: PartialEq + Parcel> PartialEq<Vec<S, T>> for Vec<S, T>[src]

impl<S: Clone + Integer, T: Clone + Parcel> Clone for Vec<S, T>[src]

default fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<S: Debug + Integer, T: Debug + Parcel> Debug for Vec<S, T>[src]

Auto Trait Implementations

impl<S, T> Send for Vec<S, T> where
    S: Send,
    T: Send

impl<S, T> Sync for Vec<S, T> where
    S: Sync,
    T: Sync

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.