[−][src]Struct type_vec::vect::Vect
The type-safe vector with type-level length.
Implementations
impl<T> Vect<T, U0>
[src]
pub fn new() -> Self
[src]
Creates an empty vector with static length.
pub fn with_capacity(capacity: usize) -> Self
[src]
Creates an empty vector with static length and with specified capacity.
pub fn len(&self) -> usize
[src]
Gets the number of elements.
impl<T> Vect<T, Dyn>
[src]
pub fn new() -> Self
[src]
Creates an empty vector with dynamic length.
pub fn from_vec(data: Vec<T>) -> Self
[src]
Creates a vector from Vec.
pub fn with_capacity(capacity: usize) -> Self
[src]
Creates an empty vector with dynamic length and with specified capacity.
pub fn len(&self) -> usize
[src]
Gets the number of elements.
pub fn into_static<S>(self) -> Option<Vect<T, S>> where
S: Unsigned + Size,
[src]
S: Unsigned + Size,
Converts a vector with static length.
The vector size must be equal to the specified static size.
Otherwise it returns None
.
impl<T, U, B> Vect<T, UInt<U, B>> where
U: Unsigned,
B: Bit,
[src]
U: Unsigned,
B: Bit,
impl<T, S> Vect<T, S> where
S: Size,
[src]
S: Size,
pub fn push(self, elem: T) -> PushImplOp<Self, T> where
(): PushImpl<Self, T>,
[src]
(): PushImpl<Self, T>,
Appends an element to the end of the vector.
pub fn pop(self) -> PopImplOp<Self> where
(): PopImpl<Self>,
[src]
(): PopImpl<Self>,
Removes an element from the end of the vector.
pub fn get<'a, I>(&'a self, index: I) -> GetImplOp<'a, Self, I::Output> where
I: IntoSize,
(): GetImpl<'a, Self, I::Output>,
[src]
I: IntoSize,
(): GetImpl<'a, Self, I::Output>,
Returns a reference to an element depending on the index.
If both length and index have static sizes, it returns &T
. Otherwise, it returns Option<&T>
.
pub fn insert<I>(self, index: I, elem: T) -> InsertImplOp<Self, I::Output, T> where
I: IntoSize,
(): InsertImpl<Self, I::Output, T>,
[src]
I: IntoSize,
(): InsertImpl<Self, I::Output, T>,
Inserts an element at specified index.
If both length and index have static sizes, it checks if the index is valid in compile time. Otherwise, it panics if the index is out of bound.
pub fn remove<I>(self, index: I) -> RemoveImplOp<Self, I::Output> where
I: IntoSize,
(): RemoveImpl<Self, I::Output>,
[src]
I: IntoSize,
(): RemoveImpl<Self, I::Output>,
Removes an element at specified index.
If both length and index have static sizes, it checks if the index is valid in compile time. Otherwise, it panics if the index is out of bound.
pub fn into_dyn(self) -> Vect<T, Dyn>
[src]
Converts to a vector with dynamic length type.
pub fn into_vec(self) -> Vec<T>
[src]
Converts to Vec.
Trait Implementations
impl<T: Clone, S: Clone> Clone for Vect<T, S> where
S: Size,
[src]
S: Size,
impl<T: Debug, S: Debug> Debug for Vect<T, S> where
S: Size,
[src]
S: Size,
impl<T: Eq, S: Eq> Eq for Vect<T, S> where
S: Size,
[src]
S: Size,
impl<'a, T, S, Index> GetImpl<'a, Vect<T, S>, Index> for () where
S: Size,
Index: Size,
(): GetPrivate<'a, Vect<T, S>, Index, CheckIndexOp<S, Index>> + CheckIndex<S, Index>,
[src]
S: Size,
Index: Size,
(): GetPrivate<'a, Vect<T, S>, Index, CheckIndexOp<S, Index>> + CheckIndex<S, Index>,
type Output = <() as GetPrivate<'a, Vect<T, S>, Index, CheckIndexOp<S, Index>>>::Output
fn impl_get(input: &'a Vect<T, S>, index: Index) -> Self::Output
[src]
impl<T: Hash, S: Hash> Hash for Vect<T, S> where
S: Size,
[src]
S: Size,
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<S, Index, Item> InsertImpl<Vect<Item, S>, Index, Item> for () where
S: Size,
Index: Size,
(): IncreaseOne<S> + CheckIndexInclusive<S, Index>,
[src]
S: Size,
Index: Size,
(): IncreaseOne<S> + CheckIndexInclusive<S, Index>,
type Output = Vect<Item, IncreaseOneOp<S>>
fn impl_insert(input: Vect<Item, S>, index: Index, item: Item) -> Self::Output
[src]
impl<T: Ord, S: Ord> Ord for Vect<T, S> where
S: Size,
[src]
S: Size,
fn cmp(&self, other: &Vect<T, S>) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<T: PartialEq, S: PartialEq> PartialEq<Vect<T, S>> for Vect<T, S> where
S: Size,
[src]
S: Size,
impl<T: PartialOrd, S: PartialOrd> PartialOrd<Vect<T, S>> for Vect<T, S> where
S: Size,
[src]
S: Size,
fn partial_cmp(&self, other: &Vect<T, S>) -> Option<Ordering>
[src]
fn lt(&self, other: &Vect<T, S>) -> bool
[src]
fn le(&self, other: &Vect<T, S>) -> bool
[src]
fn gt(&self, other: &Vect<T, S>) -> bool
[src]
fn ge(&self, other: &Vect<T, S>) -> bool
[src]
impl<__TYP_GENERIC_0, __TYP_GENERIC_1> Pop<Vect<__TYP_GENERIC_0, __TYP_GENERIC_1>> for () where
__TYP_GENERIC_1: Size,
Vect<__TYP_GENERIC_0, __TYP_GENERIC_1>: ,
(): DecreaseOne<__TYP_GENERIC_1> + __TYP_MatchArm_0<__TYP_GENERIC_0, __TYP_GENERIC_1, <() as DecreaseOne<__TYP_GENERIC_1>>::Output>,
__TYP_GENERIC_0: ,
[src]
__TYP_GENERIC_1: Size,
Vect<__TYP_GENERIC_0, __TYP_GENERIC_1>: ,
(): DecreaseOne<__TYP_GENERIC_1> + __TYP_MatchArm_0<__TYP_GENERIC_0, __TYP_GENERIC_1, <() as DecreaseOne<__TYP_GENERIC_1>>::Output>,
__TYP_GENERIC_0: ,
type Output = <() as __TYP_MatchArm_0<__TYP_GENERIC_0, __TYP_GENERIC_1, <() as DecreaseOne<__TYP_GENERIC_1>>::Output>>::Output
impl<__TYP_GENERIC_0, __TYP_GENERIC_1> Push<Vect<__TYP_GENERIC_0, __TYP_GENERIC_1>> for () where
Vect<__TYP_GENERIC_0, __TYP_GENERIC_1>: ,
<() as IncreaseOne<__TYP_GENERIC_1>>::Output: Size,
__TYP_GENERIC_0: ,
__TYP_GENERIC_1: Size,
(): IncreaseOne<__TYP_GENERIC_1>,
[src]
Vect<__TYP_GENERIC_0, __TYP_GENERIC_1>: ,
<() as IncreaseOne<__TYP_GENERIC_1>>::Output: Size,
__TYP_GENERIC_0: ,
__TYP_GENERIC_1: Size,
(): IncreaseOne<__TYP_GENERIC_1>,
type Output = Vect<__TYP_GENERIC_0, <() as IncreaseOne<__TYP_GENERIC_1>>::Output>
impl<T, S> PushImpl<Vect<T, S>, T> for () where
S: Size,
(): Push<Vect<T, S>>,
PushOp<Vect<T, S>>: VectFactory<T>,
[src]
S: Size,
(): Push<Vect<T, S>>,
PushOp<Vect<T, S>>: VectFactory<T>,
impl<S, Index, Item> RemoveImpl<Vect<Item, S>, Index> for () where
S: Size,
Index: Size,
(): DecreaseOne<S> + CheckIndex<S, Index>,
[src]
S: Size,
Index: Size,
(): DecreaseOne<S> + CheckIndex<S, Index>,
type Output = (Vect<Item, DecreaseOneOp<S>>, Item)
fn impl_remove(input: Vect<Item, S>, index: Index) -> Self::Output
[src]
impl<T, S> StructuralEq for Vect<T, S> where
S: Size,
[src]
S: Size,
impl<T, S> StructuralPartialEq for Vect<T, S> where
S: Size,
[src]
S: Size,
impl<T, S> VectFactory<T> for Vect<T, S> where
S: Size,
[src]
S: Size,
Auto Trait Implementations
impl<T, S> RefUnwindSafe for Vect<T, S> where
S: RefUnwindSafe,
T: RefUnwindSafe,
S: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, S> Send for Vect<T, S> where
S: Send,
T: Send,
S: Send,
T: Send,
impl<T, S> Sync for Vect<T, S> where
S: Sync,
T: Sync,
S: Sync,
T: Sync,
impl<T, S> Unpin for Vect<T, S> where
S: Unpin,
T: Unpin,
S: Unpin,
T: Unpin,
impl<T, S> UnwindSafe for Vect<T, S> where
S: UnwindSafe,
T: UnwindSafe,
S: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,