Struct blaze_pk::types::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<VarIntList<T>> for VarIntList<T>

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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> StructuralEq for VarIntList<T>

source§

impl<T> StructuralPartialEq for VarIntList<T>

Auto Trait Implementations§

§

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> UnwindSafe for VarIntList<T>where T: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Dwhere 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 Fwhere F: FromRequest,

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere 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 Ewhere E: Encodable + 'static,

source§

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

Into packet conversion
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more