Skip to main content

VarIntList

Struct VarIntList 

Source
pub struct VarIntList<T>(pub Vec<T>);
Expand description

List of Var ints

Tuple Fields§

§0: Vec<T>

Implementations§

Source§

impl<T> VarIntList<T>

Source

pub fn new() -> Self

Creates a new VarIntList

Source

pub fn empty() -> Self

Creates a new VarIntList with no capacity

Source

pub fn with_capacity(capacity: usize) -> Self

Creates a new VarIntList with the provided capacity

capacity The capacity for the underlying list

Source

pub fn push(&mut self, value: impl Into<T>)

Pushes a new value into the underlying list

value The value to push

Source

pub fn remove(&mut self, index: usize) -> Option<T>

Removes the value at the provided index and returns the value stored at it if there is one

index The index to remove

Source

pub fn get(&mut self, index: usize) -> Option<&T>

Retrieves the value at the provided index returning a borrow if one is there

index The index to get the value at

Trait Implementations§

Source§

impl<T: Debug> Debug for VarIntList<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<C> Decodable for VarIntList<C>
where C: VarInt,

Source§

fn decode(reader: &mut TdfReader<'_>) -> DecodeResult<Self>

Function for implementing decoding of Self from the provided Reader. Will return None if self cannot be decoded Read more
Source§

impl<T> Default for VarIntList<T>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<C> Encodable for VarIntList<C>
where C: VarInt,

Source§

fn encode(&self, output: &mut TdfWriter)

Function for implementing encoding of Self to the provided vec of bytes Read more
Source§

fn encode_bytes(&self) -> Vec<u8>

Shortcut function for encoding self directly to a Vec of bytes
Source§

impl<T: PartialEq> PartialEq for VarIntList<T>

Source§

fn eq(&self, other: &VarIntList<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T> Serialize for VarIntList<T>
where T: Serialize,

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<C> ValueType for VarIntList<C>

Source§

fn value_type() -> TdfType

The type of tdf value this is
Source§

impl<T: Eq> Eq for VarIntList<T>

Source§

impl<T> StructuralPartialEq for VarIntList<T>

Auto Trait Implementations§

§

impl<T> Freeze for VarIntList<T>

§

impl<T> RefUnwindSafe for VarIntList<T>
where T: RefUnwindSafe,

§

impl<T> Send for VarIntList<T>
where T: Send,

§

impl<T> Sync for VarIntList<T>
where T: Sync,

§

impl<T> Unpin for VarIntList<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for VarIntList<T>

§

impl<T> UnwindSafe for VarIntList<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<D> FromRequest for D
where D: Decodable + Send + 'static,

Source§

fn from_request(req: &Packet) -> Result<D, DecodeError>

Takes the value from the request returning a decode result of whether the value could be created Read more
Source§

impl<F> FromRequestInternal for F
where F: FromRequest,

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<E> IntoResponse for E
where E: Encodable + 'static,

Source§

fn into_response(self, req: &Packet) -> Packet

Into packet conversion
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.