typenum::array

Struct TArr

Source
pub struct TArr<V, A> { /* private fields */ }
Expand description

TArr is a type that acts as an array of types. It is defined similarly to UInt, only its values can be more than bits, and it is designed to act as an array. So you can only add two if they have the same number of elements, for example.

This array is only really designed to contain Integer types. If you use it with others, you may find it lacking functionality.

Trait Implementations§

Source§

impl<Al, Vl, Ar, Vr> Add<TArr<Vr, Ar>> for TArr<Vl, Al>
where Al: Add<Ar>, Vl: Add<Vr>,

Source§

type Output = TArr<<Vl as Add<Vr>>::Output, <Al as Add<Ar>>::Output>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: TArr<Vr, Ar>) -> Self::Output

Performs the + operation. Read more
Source§

impl<V: Clone, A: Clone> Clone for TArr<V, A>

Source§

fn clone(&self) -> TArr<V, A>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<V: Debug, A: Debug> Debug for TArr<V, A>

Source§

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

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

impl<V, A, Rhs> Div<Rhs> for TArr<V, A>
where V: Div<Rhs>, A: Div<Rhs>, Rhs: Copy,

Source§

type Output = TArr<<V as Div<Rhs>>::Output, <A as Div<Rhs>>::Output>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Rhs) -> Self::Output

Performs the / operation. Read more
Source§

impl<V: Hash, A: Hash> Hash for TArr<V, A>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<V, A> Len for TArr<V, A>
where A: Len, Length<A>: Add<B1>, Sum<Length<A>, B1>: Unsigned,

Size of a TypeArray

Source§

type Output = <<A as Len>::Output as Add<B1>>::Output

The length as a type-level unsigned integer.
Source§

fn len(&self) -> Self::Output

This function isn’t used in this crate, but may be useful for others.
Source§

impl<V, A, Rhs> Mul<Rhs> for TArr<V, A>
where V: Mul<Rhs>, A: Mul<Rhs>, Rhs: Copy,

Source§

type Output = TArr<<V as Mul<Rhs>>::Output, <A as Mul<Rhs>>::Output>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Rhs) -> Self::Output

Performs the * operation. Read more
Source§

impl<V, A, U> Mul<TArr<V, A>> for NInt<U>
where U: Unsigned + NonZero, NInt<U>: Mul<A> + Mul<V>,

Source§

type Output = TArr<<NInt<U> as Mul<V>>::Output, <NInt<U> as Mul<A>>::Output>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: TArr<V, A>) -> Self::Output

Performs the * operation. Read more
Source§

impl<V, A, U> Mul<TArr<V, A>> for PInt<U>
where U: Unsigned + NonZero, PInt<U>: Mul<A> + Mul<V>,

Source§

type Output = TArr<<PInt<U> as Mul<V>>::Output, <PInt<U> as Mul<A>>::Output>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: TArr<V, A>) -> Self::Output

Performs the * operation. Read more
Source§

impl<V, A> Mul<TArr<V, A>> for Z0
where Z0: Mul<A>,

Source§

type Output = TArr<Z0, <Z0 as Mul<A>>::Output>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: TArr<V, A>) -> Self::Output

Performs the * operation. Read more
Source§

impl<V, A> Neg for TArr<V, A>
where V: Neg, A: Neg,

Source§

type Output = TArr<<V as Neg>::Output, <A as Neg>::Output>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<V: Ord, A: Ord> Ord for TArr<V, A>

Source§

fn cmp(&self, other: &TArr<V, A>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<V, A, Rhs> PartialDiv<Rhs> for TArr<V, A>
where V: PartialDiv<Rhs>, A: PartialDiv<Rhs>, Rhs: Copy,

Source§

type Output = TArr<<V as PartialDiv<Rhs>>::Output, <A as PartialDiv<Rhs>>::Output>

The type of the result of the division
Source§

fn partial_div(self, rhs: Rhs) -> Self::Output

Method for performing the division
Source§

impl<V: PartialEq, A: PartialEq> PartialEq for TArr<V, A>

Source§

fn eq(&self, other: &TArr<V, A>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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<V: PartialOrd, A: PartialOrd> PartialOrd for TArr<V, A>

Source§

fn partial_cmp(&self, other: &TArr<V, A>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<V, A, Rhs> Rem<Rhs> for TArr<V, A>
where V: Rem<Rhs>, A: Rem<Rhs>, Rhs: Copy,

Source§

type Output = TArr<<V as Rem<Rhs>>::Output, <A as Rem<Rhs>>::Output>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: Rhs) -> Self::Output

Performs the % operation. Read more
Source§

impl<Vl, Al, Vr, Ar> Sub<TArr<Vr, Ar>> for TArr<Vl, Al>
where Vl: Sub<Vr>, Al: Sub<Ar>,

Source§

type Output = TArr<<Vl as Sub<Vr>>::Output, <Al as Sub<Ar>>::Output>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: TArr<Vr, Ar>) -> Self::Output

Performs the - operation. Read more
Source§

impl<V: Copy, A: Copy> Copy for TArr<V, A>

Source§

impl<V: Eq, A: Eq> Eq for TArr<V, A>

Source§

impl<V, A> StructuralPartialEq for TArr<V, A>

Source§

impl<V, A> TypeArray for TArr<V, A>

Auto Trait Implementations§

§

impl<V, A> Freeze for TArr<V, A>
where V: Freeze, A: Freeze,

§

impl<V, A> RefUnwindSafe for TArr<V, A>

§

impl<V, A> Send for TArr<V, A>
where V: Send, A: Send,

§

impl<V, A> Sync for TArr<V, A>
where V: Sync, A: Sync,

§

impl<V, A> Unpin for TArr<V, A>
where V: Unpin, A: Unpin,

§

impl<V, A> UnwindSafe for TArr<V, A>
where V: UnwindSafe, A: 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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<T> Same for T

Source§

type Output = T

Should always be Self
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.