Struct mdarray::Const

source ·
pub struct Const<const N: usize>;
Expand description

Type-level constant.

Trait Implementations§

source§

impl<const N: usize> Clone for Const<N>

source§

fn clone(&self) -> Const<N>

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<const N: usize> Debug for Const<N>

source§

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

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

impl<const N: usize> Default for Const<N>

source§

fn default() -> Const<N>

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

impl<const N: usize> Dim for Const<N>

§

type Merge<D: Dim> = Const<N>

Merge dimensions, where constant size is preferred over dynamic.
§

type FromExpr<T, S: Shape> = <<S as Shape>::FromExpr<T> as FromExpression<T, S>>::WithConst<N>

The resulting type after conversion from an expression.
source§

const SIZE: Option<usize> = _

Dimension size if known statically, or None if dynamic.
source§

fn from_size(size: usize) -> Self

Creates an array dimension with the given size. Read more
source§

fn size(self) -> usize

Returns the number of elements in the dimension.
source§

impl<const N: usize> Copy for Const<N>

Auto Trait Implementations§

§

impl<const N: usize> Freeze for Const<N>

§

impl<const N: usize> RefUnwindSafe for Const<N>

§

impl<const N: usize> Send for Const<N>

§

impl<const N: usize> Sync for Const<N>

§

impl<const N: usize> Unpin for Const<N>

§

impl<const N: usize> UnwindSafe for Const<N>

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§

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

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

impl<T> CloneToUninit for T
where T: Copy,

source§

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

🔬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> IntoCloned<T> for T

source§

fn clone_to(self, target: &mut T)

Moves an existing object or clones from a reference to the target object.
source§

fn into_cloned(self) -> T

Returns an existing object or a new clone from a reference.
source§

impl<S> IntoShape for S
where S: Shape,

§

type IntoShape = S

Which kind of array shape are we turning this into?
source§

fn into_shape(self) -> S

Creates array shape from a value.
source§

impl<X> Shape for X
where X: Dim,

§

type Head = X

First dimension.
§

type Tail = ()

Shape excluding the first dimension.
§

type Reverse = X

Shape with the reverse ordering of dimensions.
§

type Prepend<D: Dim> = (D, X)

Prepend the dimension to the shape.
§

type Merge<S: Shape> = <<S as Shape>::Tail as Shape>::Prepend<<X as Dim>::Merge<<S as Shape>::Head>>

Merge each dimension pair, where constant size is preferred over dynamic. The result has dynamic rank if at least one of the inputs has dynamic rank.
§

type FromExpr<T> = <X as Dim>::FromExpr<T, ()>

The resulting type after conversion from an expression.
§

type Layout<L: Layout, M: Layout> = L

Select layout Dense, L, or M for rank 0, 1, or >1 respectively.
§

type Dims = [usize; 1]

Array dimensions type.
§

type Strides = [isize; 1]

Array strides type.
source§

const RANK: usize = 1usize

Array rank, i.e. the number of dimensions.
source§

fn dims(self) -> [usize; 1]

Returns the number of elements in each dimension.
source§

fn from_dims(dims: [usize; 1]) -> X

Creates an array shape with the given dimensions. Read more
source§

fn dim(self, index: usize) -> usize

Returns the number of elements in the specified dimension. Read more
source§

fn is_empty(self) -> bool

Returns true if the array contains no elements.
source§

fn len(self) -> usize

Returns the number of elements in the array.
source§

fn rank(self) -> usize

Returns the array rank, i.e. the number of dimensions.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where 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 T
where 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.