Skip to main content

Array

Struct Array 

Source
pub struct Array<T: Element, D: Dimension> { /* private fields */ }
Expand description

An owned, heap-allocated N-dimensional array.

This is the primary array type in ferray — analogous to numpy.ndarray with full ownership of its data buffer.

T is the element type (must implement Element) and D describes the dimensionality (Ix1, Ix2, …, IxDyn).

Implementations§

Source§

impl<T: Element, D: Dimension> Array<T, D>

Source

pub fn broadcast_to( &self, target_shape: &[usize], ) -> FerrayResult<ArrayView<'_, T, IxDyn>>

Broadcast this array to the given shape, returning a dynamic-rank view.

Uses stride-0 tricks for virtual expansion — no data is copied.

§Errors

Returns FerrayError::BroadcastFailure if the array cannot be broadcast to the target shape.

Source§

impl<T, D> Array<T, D>
where T: Element, D: Dimension,

Source

pub fn cast<U: Element>(&self, casting: CastKind) -> FerrayResult<Array<U, D>>
where T: CastTo<U>,

Cast this array to element type U with the given safety check.

This is the general-purpose casting method matching NumPy’s arr.astype(dtype, casting=...). Unlike AsType::astype (which is restricted to safe widening), this method permits any cast as long as can_cast(T::dtype(), U::dtype(), casting) returns true.

§Arguments
§Errors

Returns FerrayError::InvalidDtype if the requested cast is not permitted at the chosen safety level.

§Examples
let a = Array::<f64, Ix1>::from_vec(Ix1::new([3]), vec![1.5, 2.7, -3.9]).unwrap();
// f64 -> i32 truncates per `as` semantics
let b = a.cast::<i32>(CastKind::Unsafe).unwrap();
assert_eq!(b.as_slice().unwrap(), &[1, 2, -3]);
Source§

impl<T: Element, D: Dimension> Array<T, D>

Source

pub fn add_promoted<U>( &self, other: &Array<U, D>, ) -> FerrayResult<Array<<T as Promoted<U>>::Output, D>>
where U: Element + PromoteTo<<T as Promoted<U>>::Output>, T: Promoted<U> + PromoteTo<<T as Promoted<U>>::Output>, <T as Promoted<U>>::Output: Element + Add<Output = <T as Promoted<U>>::Output>,

Add two arrays after promoting both to their common type.

This is the explicit way to perform mixed-type addition (REQ-24). Implicit mixed-type + does not compile.

Source

pub fn sub_promoted<U>( &self, other: &Array<U, D>, ) -> FerrayResult<Array<<T as Promoted<U>>::Output, D>>
where U: Element + PromoteTo<<T as Promoted<U>>::Output>, T: Promoted<U> + PromoteTo<<T as Promoted<U>>::Output>, <T as Promoted<U>>::Output: Element + Sub<Output = <T as Promoted<U>>::Output>,

Subtract two arrays after promoting both to their common type.

Source

pub fn mul_promoted<U>( &self, other: &Array<U, D>, ) -> FerrayResult<Array<<T as Promoted<U>>::Output, D>>
where U: Element + PromoteTo<<T as Promoted<U>>::Output>, T: Promoted<U> + PromoteTo<<T as Promoted<U>>::Output>, <T as Promoted<U>>::Output: Element + Mul<Output = <T as Promoted<U>>::Output>,

Multiply two arrays after promoting both to their common type.

Source

pub fn div_promoted<U>( &self, other: &Array<U, D>, ) -> FerrayResult<Array<<T as Promoted<U>>::Output, D>>
where U: Element + PromoteTo<<T as Promoted<U>>::Output>, T: Promoted<U> + PromoteTo<<T as Promoted<U>>::Output>, <T as Promoted<U>>::Output: Element + Div<Output = <T as Promoted<U>>::Output>,

Divide two arrays after promoting both to their common type.

Source§

impl<T: Element, D: Dimension> Array<T, D>

Source

pub fn itemsize(&self) -> usize

Size in bytes of a single element.

Source

pub fn nbytes(&self) -> usize

Total size in bytes of all elements (size * itemsize).

Source

pub fn dtype(&self) -> DType

Runtime dtype tag for this array’s element type.

Source

pub fn t(&self) -> ArrayView<'_, T, D>

Transposed view (zero-copy). Reverses the axes.

This is the equivalent of NumPy’s .T property.

Source

pub fn copy(&self) -> Self

Deep copy of this array.

Source

pub fn to_vec_flat(&self) -> Vec<T>

Convert to a flat Vec<T> in logical (row-major) order.

Source

pub fn to_bytes(&self) -> FerrayResult<&[u8]>
where T: Copy,

Return the raw bytes of the array data.

Only succeeds if the array is contiguous; returns an error otherwise. Requires T: Copy to guarantee no padding bytes exist.

Source

pub fn flags(&self) -> ArrayFlags

Return flags describing memory properties.

Source§

impl<T: Element, D: Dimension> Array<T, D>

Source

pub fn iter(&self) -> impl Iterator<Item = &T> + '_

Iterate over all elements in logical (row-major) order.

Source

pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut T> + '_

Mutably iterate over all elements in logical order.

Source

pub fn indexed_iter(&self) -> impl Iterator<Item = (Vec<usize>, &T)> + '_

Iterate with multi-dimensional indices.

Yields (Vec<usize>, &T) pairs in logical order. The index vector has one entry per dimension.

Delegates to ndarray’s cached indexed_iter, which carries a typed index through the walk (no per-element divmod on a flat index as the previous hand-rolled implementation did, see issue #80). The public Vec<usize> return type forces a single allocation per yielded element; any further win requires an API change to a streaming iterator or &[usize] signature.

Source

pub fn flat(&self) -> impl Iterator<Item = &T> + '_

Flat iterator — same as iter() but emphasises logical-order traversal.

Source

pub fn lanes( &self, axis: Axis, ) -> FerrayResult<impl Iterator<Item = ArrayView<'_, T, Ix1>> + '_>

Iterate over lanes (1-D slices) along the given axis.

For a 2-D array with axis=1, this yields each row. For axis=0, this yields each column.

§Errors

Returns FerrayError::AxisOutOfBounds if axis >= ndim.

Source

pub fn axis_iter( &self, axis: Axis, ) -> FerrayResult<impl Iterator<Item = ArrayView<'_, T, IxDyn>> + '_>

Iterate over sub-arrays along the given axis.

For a 3-D array with shape [2,3,4] and axis=0, this yields two 2-D views each of shape [3,4].

§Errors

Returns FerrayError::AxisOutOfBounds if axis >= ndim.

Source

pub fn axis_iter_mut( &mut self, axis: Axis, ) -> FerrayResult<impl Iterator<Item = ArrayViewMut<'_, T, IxDyn>> + '_>

Mutably iterate over sub-arrays along the given axis.

§Errors

Returns FerrayError::AxisOutOfBounds if axis >= ndim.

Source§

impl<T: Element, D: Dimension> Array<T, D>

Source

pub fn mapv(&self, f: impl Fn(T) -> T) -> Self

Apply a closure to every element, returning a new array.

The closure receives each element by value (cloned) and must return the same type. For type-changing maps, collect via iterators.

Source

pub fn mapv_inplace(&mut self, f: impl Fn(T) -> T)

Apply a closure to every element in place.

Source

pub fn zip_mut_with( &mut self, other: &Array<T, D>, f: impl Fn(&mut T, &T), ) -> FerrayResult<()>

Zip this array mutably with another array of the same shape, applying a closure to each pair of elements.

The closure receives (&mut T, &T) — the first element is from self and can be modified, the second is from other.

§Errors

Returns FerrayError::ShapeMismatch if shapes differ.

Source

pub fn fold_axis( &self, axis: Axis, init: T, fold: impl FnMut(&T, &T) -> T, ) -> FerrayResult<Array<T, IxDyn>>

Fold (reduce) along the given axis.

init provides the initial accumulator value for each lane. The closure receives (accumulator, &element) and must return the new accumulator.

Returns an array with one fewer dimension (the folded axis removed). The result is always returned as a dynamic-rank array.

§Errors

Returns FerrayError::AxisOutOfBounds if axis >= ndim.

Source

pub fn map_to<U: Element>(&self, f: impl Fn(T) -> U) -> Array<U, D>

Apply a closure elementwise, producing an array of a different type.

Unlike mapv which preserves the element type, this allows mapping to a different Element type.

Source

pub fn to_dyn(&self) -> Array<T, IxDyn>

Convert this array to a dynamic-rank Array<T, IxDyn>.

This is a cheap conversion (re-wraps the same data) and is needed to call functions like crate::manipulation::concatenate which take dynamic-rank slices.

Source

pub fn into_dyn(self) -> Array<T, IxDyn>

Consume this array and return a dynamic-rank Array<T, IxDyn>.

Like Array::to_dyn but takes ownership to avoid the clone.

Source

pub fn as_standard_layout(&self) -> CowArray<'_, T, D>

Return a C-contiguous (row-major) version of this array, copying only if the current layout is not already C-contiguous (#351).

Equivalent to NumPy’s np.ascontiguousarray. The returned CowArray borrows from self when no copy is needed, so this is a zero-cost guard before BLAS calls, SIMD loops, or FFI that require row-major storage.

Source

pub fn as_fortran_layout(&self) -> CowArray<'_, T, D>

Return a Fortran-contiguous (column-major) version of this array, copying only if the current layout is not already F-contiguous (#351).

Equivalent to NumPy’s np.asfortranarray. The returned CowArray borrows from self when no copy is needed. 1-D arrays are borrowed because they are trivially both C- and F-contiguous.

Source§

impl<T: Element, D: Dimension> Array<T, D>

Source

pub fn into_ndarray(self) -> Array<T, D::NdarrayDim>

Unwrap to the internal ndarray::Array. Crate-internal. Consume this ferray array and return the underlying ndarray::Array, preserving shape and layout.

This is the escape hatch for interop with crates that already work with ndarray (notably numpy/PyO3’s [PyArray::from_owned_array], which avoids a reshape round-trip). Calls through to a move — no allocation or copy.

Source

pub fn from_elem(dim: D, elem: T) -> FerrayResult<Self>

Create a new array filled with the given value.

§Errors

Returns FerrayError::InvalidValue if the shape has zero dimensions but D is a fixed-rank type with nonzero rank, or vice versa.

Source

pub fn zeros(dim: D) -> FerrayResult<Self>

Create a new array filled with zeros.

Source

pub fn ones(dim: D) -> FerrayResult<Self>

Create a new array filled with ones.

Source

pub fn from_vec(dim: D, data: Vec<T>) -> FerrayResult<Self>

Create an array from a flat vector and a shape.

§Errors

Returns FerrayError::ShapeMismatch if data.len() does not equal the product of the shape dimensions.

Source

pub fn from_vec_f(dim: D, data: Vec<T>) -> FerrayResult<Self>

Create an array from a flat vector with Fortran (column-major) layout.

§Errors

Returns FerrayError::ShapeMismatch if lengths don’t match.

Source

pub fn from_iter_1d(iter: impl IntoIterator<Item = T>) -> FerrayResult<Self>
where D: Dimension<NdarrayDim = Ix1>,

Create a 1-D array from an iterator.

This only makes sense for D = Ix1; for other dimensions, collect first and use from_vec.

Source

pub fn layout(&self) -> MemoryLayout

Return the memory layout of this array.

Source

pub fn ndim(&self) -> usize

Number of dimensions.

Source

pub fn shape(&self) -> &[usize]

Shape as a slice.

Source

pub fn strides(&self) -> &[isize]

Strides as a slice (in units of elements, not bytes).

Source

pub fn size(&self) -> usize

Total number of elements.

Source

pub fn is_empty(&self) -> bool

Whether the array has zero elements.

Source

pub fn as_ptr(&self) -> *const T

Return a raw pointer to the first element.

Source

pub fn as_mut_ptr(&mut self) -> *mut T

Return a mutable raw pointer to the first element.

Source

pub fn as_slice(&self) -> Option<&[T]>

Return the data as a contiguous slice, if the layout allows it.

Source

pub fn as_slice_mut(&mut self) -> Option<&mut [T]>

Return the data as a contiguous mutable slice, if the layout allows it.

Source

pub fn dim(&self) -> &D

Return a reference to the internal dimension descriptor.

Source§

impl<T, D> Array<T, D>
where T: Element + Copy, D: Dimension,

Source

pub fn sum(&self) -> T
where T: Add<Output = T>,

Sum of all elements (whole-array reduction).

Returns Element::zero() for an empty array.

§Examples
let a = Array::<f64, Ix1>::from_vec(Ix1::new([3]), vec![1.0, 2.0, 3.0]).unwrap();
assert_eq!(a.sum(), 6.0);
Source

pub fn sum_axis(&self, axis: Axis) -> FerrayResult<Array<T, IxDyn>>
where T: Add<Output = T>, D::NdarrayDim: RemoveAxis,

Sum along the given axis. Returns an array with one fewer dimension.

§Errors

Returns FerrayError::AxisOutOfBounds if axis >= ndim.

Source

pub fn prod(&self) -> T
where T: Mul<Output = T>,

Product of all elements.

Returns Element::one() for an empty array.

Source

pub fn prod_axis(&self, axis: Axis) -> FerrayResult<Array<T, IxDyn>>
where T: Mul<Output = T>, D::NdarrayDim: RemoveAxis,

Product along the given axis.

Source§

impl<T, D> Array<T, D>
where T: Element + Copy + PartialOrd, D: Dimension,

Source

pub fn min(&self) -> Option<T>

Minimum value across the entire array.

Returns None if the array is empty. NaN values follow NumPy semantics: once a NaN is seen the result stays NaN, detected via self-comparison (x.partial_cmp(&x).is_none()).

Source

pub fn max(&self) -> Option<T>

Maximum value across the entire array.

Returns None if the array is empty. NaN values propagate per NumPy.

Source

pub fn min_axis(&self, axis: Axis) -> FerrayResult<Array<T, IxDyn>>

Minimum value along an axis.

§Errors

Returns FerrayError::AxisOutOfBounds if axis >= ndim, or FerrayError::ShapeMismatch if the resulting axis would be empty.

Source

pub fn max_axis(&self, axis: Axis) -> FerrayResult<Array<T, IxDyn>>

Maximum value along an axis.

See Array::min_axis for error semantics.

Source§

impl<T, D> Array<T, D>
where T: Element + Float, D: Dimension,

Source

pub fn mean(&self) -> Option<T>

Arithmetic mean of all elements. Returns None for an empty array.

Source

pub fn mean_axis(&self, axis: Axis) -> FerrayResult<Array<T, IxDyn>>

Mean along an axis.

Source

pub fn var(&self, ddof: usize) -> Option<T>

Variance with ddof degrees of freedom (Bessel’s correction = 1).

Returns None for an empty array, or when ddof >= n.

Source

pub fn std(&self, ddof: usize) -> Option<T>

Standard deviation with ddof degrees of freedom.

Source§

impl<D> Array<bool, D>
where D: Dimension,

Source

pub fn any(&self) -> bool

Returns true if any element is true.

Source

pub fn all(&self) -> bool

Returns true if all elements are true. Vacuously true for empty arrays.

Source§

impl<T, D> Array<T, D>
where T: Element + PartialOrd, D: Dimension,

Source

pub fn sorted(&self) -> Array<T, Ix1>

Return a sorted 1-D copy of the flattened array in ascending order.

Equivalent to np.sort(a.ravel()). NaN values (for floating-point element types) are ordered last, matching NumPy’s convention.

For axis-aware sorting or algorithm selection (mergesort, heapsort), use ferray_stats::sorting::sort.

Source

pub fn argsort(&self) -> Array<u64, Ix1>

Return the indices that would sort the flattened array in ascending order.

Equivalent to np.argsort(a.ravel()). The returned indices are u64 to match NumPy’s default index dtype. NaN values are sent to the tail of the sort order, matching Array::sorted.

For axis-aware argsort, use ferray_stats::sorting::argsort.

Source§

impl<T: Element, D: Dimension> Array<T, D>

Source

pub fn view(&self) -> ArrayView<'_, T, D>

Create an immutable view of this array.

Source§

impl<T: Element, D: Dimension> Array<T, D>

Source

pub fn view_mut(&mut self) -> ArrayViewMut<'_, T, D>

Create a mutable view of this array.

Source§

impl<T: Element, D: Dimension> Array<T, D>

Source

pub fn index_select( &self, axis: Axis, indices: &[isize], ) -> FerrayResult<Array<T, IxDyn>>

Select elements along an axis using an array of indices.

This is advanced (fancy) indexing — it always returns a copy. The result has the same number of dimensions as the input, but the size along axis is replaced by indices.len().

Negative indices are supported (counting from end).

§Errors
  • AxisOutOfBounds if axis >= ndim
  • IndexOutOfBounds if any index is out of range
Source

pub fn boolean_index( &self, mask: &Array<bool, D>, ) -> FerrayResult<Array<T, Ix1>>

Select elements using a boolean mask.

Returns a 1-D array containing elements where mask is true. This is always a copy.

The mask must be broadcastable to the array’s shape, or have the same total number of elements. When the mask is 1-D and the array is N-D, the mask is applied to the flattened array.

§Errors
  • ShapeMismatch if mask shape is incompatible
Source

pub fn boolean_index_flat( &self, mask: &Array<bool, Ix1>, ) -> FerrayResult<Array<T, Ix1>>

Boolean indexing with a flat mask (1-D mask on N-D array).

The mask is applied to the flattened (row-major) array.

§Errors
  • ShapeMismatch if mask.len() != self.size()
Source

pub fn boolean_index_assign( &mut self, mask: &Array<bool, D>, value: T, ) -> FerrayResult<()>

Assign a scalar value to elements selected by a boolean mask.

Equivalent to a[mask] = value in NumPy.

§Errors
  • ShapeMismatch if mask shape differs from array shape
Source

pub fn boolean_index_assign_array( &mut self, mask: &Array<bool, D>, values: &Array<T, Ix1>, ) -> FerrayResult<()>

Assign values from an array to elements selected by a boolean mask.

values must have exactly as many elements as mask has true entries.

§Errors
  • ShapeMismatch if mask shape differs or values length mismatches
Source§

impl<T: Element, D: Dimension> Array<T, D>

Source

pub fn index_axis( &self, axis: Axis, index: isize, ) -> FerrayResult<ArrayView<'_, T, IxDyn>>

Index into the array along a given axis, removing that axis.

Equivalent to a[i] for axis 0, or a[:, i] for axis 1, etc. Returns a view with one fewer dimension (dynamic-rank).

§Errors
  • AxisOutOfBounds if axis >= ndim
  • IndexOutOfBounds if index is out of range (supports negative)
Source

pub fn slice_axis( &self, axis: Axis, spec: SliceSpec, ) -> FerrayResult<ArrayView<'_, T, IxDyn>>

Slice the array along a given axis, returning a view.

The returned view shares data with the source (zero-copy).

§Errors
  • AxisOutOfBounds if axis >= ndim
  • InvalidValue if step is zero
Source

pub fn slice_axis_mut( &mut self, axis: Axis, spec: SliceSpec, ) -> FerrayResult<ArrayViewMut<'_, T, IxDyn>>

Slice the array along a given axis, returning a mutable view.

§Errors

Same as slice_axis.

Source

pub fn slice_multi( &self, specs: &[SliceSpec], ) -> FerrayResult<ArrayView<'_, T, IxDyn>>

Multi-axis slicing: apply a slice specification to each axis.

specs must have length equal to ndim(). For axes you don’t want to slice, pass SliceSpec::full().

§Errors
  • InvalidValue if specs.len() != ndim()
  • Any errors from individual axis slicing
Source

pub fn insert_axis(&self, axis: Axis) -> FerrayResult<ArrayView<'_, T, IxDyn>>

Insert a new axis of length 1 at the given position.

This is equivalent to np.expand_dims or np.newaxis. Returns a dynamic-rank view with one more dimension.

§Errors
  • AxisOutOfBounds if axis > ndim
Source

pub fn remove_axis(&self, axis: Axis) -> FerrayResult<ArrayView<'_, T, IxDyn>>

Remove an axis of length 1.

This is equivalent to np.squeeze for a single axis. Returns a dynamic-rank view with one fewer dimension.

§Errors
  • AxisOutOfBounds if axis >= ndim
  • InvalidValue if the axis has size != 1
Source

pub fn flat_index(&self, index: isize) -> FerrayResult<&T>

Index into the array with a flat (linear) index.

Elements are ordered in row-major (C) order. The flat index is converted to a multi-dimensional index via unravel, then stride arithmetic computes the physical offset in O(ndim) time.

§Errors

Returns IndexOutOfBounds if the index is out of range.

Source

pub fn get(&self, indices: &[isize]) -> FerrayResult<&T>

Get a reference to a single element by multi-dimensional index.

Supports negative indices (counting from end).

§Errors
  • InvalidValue if indices.len() != ndim()
  • IndexOutOfBounds if any index is out of range
Source

pub fn get_mut(&mut self, indices: &[isize]) -> FerrayResult<&mut T>

Get a mutable reference to a single element by multi-dimensional index.

§Errors

Same as get.

Source§

impl<T: Element, D: Dimension> Array<T, D>

Source

pub fn put(&mut self, indices: &[isize], values: &[T]) -> FerrayResult<()>

Put values into the flattened array at the given indices.

Equivalent to np.put(a, ind, v). Modifies the array in-place. Indices refer to the flattened (row-major) array. Values are cycled if fewer than indices.

§Errors
  • IndexOutOfBounds if any index is out of range
  • InvalidValue if values is empty
Source

pub fn put_along_axis( &mut self, indices: &[isize], values: &Array<T, IxDyn>, axis: Axis, ) -> FerrayResult<()>

Put values along an axis at specified indices.

For each index position along axis, assigns the values from the corresponding sub-array of values.

§Errors
  • AxisOutOfBounds if axis >= ndim
  • IndexOutOfBounds if any index is out of range
Source

pub fn fill_diagonal(&mut self, val: T)

Fill the main diagonal of a 2-D (or N-D) array with a value.

For N-D arrays, the diagonal consists of indices where all index values are equal: a[i, i, ..., i].

Equivalent to np.fill_diagonal(a, val).

Source§

impl<T, D> Array<T, D>
where T: Element + Copy, D: Dimension,

Source

pub fn add_broadcast<D2: Dimension>( &self, other: &Array<T, D2>, ) -> FerrayResult<Array<T, IxDyn>>
where T: Add<Output = T>,

Elementwise add with NumPy broadcasting across arbitrary ranks.

Returns a dynamic-rank Array<T, IxDyn> so that mixed-rank inputs (e.g. 1D + 2D) can produce a result whose rank is determined at runtime. For same-rank inputs prefer the + operator.

§Errors

Returns FerrayError::ShapeMismatch if shapes are not broadcast-compatible.

Source

pub fn sub_broadcast<D2: Dimension>( &self, other: &Array<T, D2>, ) -> FerrayResult<Array<T, IxDyn>>
where T: Sub<Output = T>,

Elementwise subtract with NumPy broadcasting across arbitrary ranks.

See Array::add_broadcast for details.

Source

pub fn mul_broadcast<D2: Dimension>( &self, other: &Array<T, D2>, ) -> FerrayResult<Array<T, IxDyn>>
where T: Mul<Output = T>,

Elementwise multiply with NumPy broadcasting across arbitrary ranks.

See Array::add_broadcast for details.

Source

pub fn div_broadcast<D2: Dimension>( &self, other: &Array<T, D2>, ) -> FerrayResult<Array<T, IxDyn>>
where T: Div<Output = T>,

Elementwise divide with NumPy broadcasting across arbitrary ranks.

See Array::add_broadcast for details.

Source

pub fn rem_broadcast<D2: Dimension>( &self, other: &Array<T, D2>, ) -> FerrayResult<Array<T, IxDyn>>
where T: Rem<Output = T>,

Elementwise remainder with NumPy broadcasting across arbitrary ranks.

See Array::add_broadcast for details.

Source§

impl<T, D> Array<T, D>
where T: Element + Copy, D: Dimension,

Source

pub fn add_inplace(&mut self, other: &Array<T, D>) -> FerrayResult<()>
where T: Add<Output = T>,

In-place elementwise add: self[i] += other[i]. other is broadcast into self.shape(); the destination shape never changes.

Prefer this over self = (&self + &other)? for large arrays — it avoids allocating a new result buffer.

§Errors

Returns FerrayError::ShapeMismatch if other.shape() cannot be broadcast into self.shape().

Source

pub fn sub_inplace(&mut self, other: &Array<T, D>) -> FerrayResult<()>
where T: Sub<Output = T>,

In-place elementwise subtract. See Array::add_inplace.

Source

pub fn mul_inplace(&mut self, other: &Array<T, D>) -> FerrayResult<()>
where T: Mul<Output = T>,

In-place elementwise multiply. See Array::add_inplace.

Source

pub fn div_inplace(&mut self, other: &Array<T, D>) -> FerrayResult<()>
where T: Div<Output = T>,

In-place elementwise divide. See Array::add_inplace.

Source

pub fn rem_inplace(&mut self, other: &Array<T, D>) -> FerrayResult<()>
where T: Rem<Output = T>,

In-place elementwise remainder. See Array::add_inplace.

Source§

impl<T, D> Array<T, D>
where T: Element, D: Dimension,

Source

pub fn copy_from<D2: Dimension>( &mut self, src: &Array<T, D2>, ) -> FerrayResult<()>

Copy values from src into self, broadcasting src to self.shape().

See copyto for the free-function form and full semantics.

§Errors

Returns FerrayError::ShapeMismatch if src cannot be broadcast into self.shape(). On error self is left untouched.

Source

pub fn copy_from_where<D2: Dimension, D3: Dimension>( &mut self, src: &Array<T, D2>, mask: &Array<bool, D3>, ) -> FerrayResult<()>

Copy values from src into self at positions where mask is true, broadcasting both inputs to self.shape().

See copyto_where for the free-function form and full semantics.

§Errors

Returns FerrayError::ShapeMismatch if src or mask cannot be broadcast into self.shape(). On error self is left untouched.

Trait Implementations§

Source§

impl<T, D> Add<&Array<T, D>> for &Array<T, D>
where T: Element + Copy + Add<Output = T>, D: Dimension,

Source§

type Output = Result<Array<T, D>, FerrayError>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Array<T, D>) -> Self::Output

Performs the + operation. Read more
Source§

impl<T, D> Add<&Array<T, D>> for Array<T, D>
where T: Element + Copy + Add<Output = T>, D: Dimension,

Source§

type Output = Result<Array<T, D>, FerrayError>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Array<T, D>) -> Self::Output

Performs the + operation. Read more
Source§

impl<T, D> Add<Array<T, D>> for &Array<T, D>
where T: Element + Copy + Add<Output = T>, D: Dimension,

Source§

type Output = Result<Array<T, D>, FerrayError>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Array<T, D>) -> Self::Output

Performs the + operation. Read more
Source§

impl<T, D> Add<T> for &Array<T, D>
where T: Element + Copy + Add<Output = T>, D: Dimension,

Source§

type Output = Result<Array<T, D>, FerrayError>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: T) -> Self::Output

Performs the + operation. Read more
Source§

impl<T, D> Add<T> for Array<T, D>
where T: Element + Copy + Add<Output = T>, D: Dimension,

Source§

type Output = Result<Array<T, D>, FerrayError>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: T) -> Self::Output

Performs the + operation. Read more
Source§

impl<T, D> Add for Array<T, D>
where T: Element + Copy + Add<Output = T>, D: Dimension,

Source§

type Output = Result<Array<T, D>, FerrayError>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Array<T, D>) -> Self::Output

Performs the + operation. Read more
Source§

impl<T, D> AddAssign<T> for Array<T, D>
where T: Element + Copy + AddAssign, D: Dimension,

Source§

fn add_assign(&mut self, rhs: T)

Performs the += operation. Read more
Source§

impl<T: Element, D: Dimension> AsRawBuffer for Array<T, D>

Source§

fn raw_ptr(&self) -> *const u8

Raw pointer to the first element.
Source§

fn raw_shape(&self) -> &[usize]

Shape as a slice of dimension sizes.
Source§

fn raw_strides_bytes(&self) -> Vec<isize>

Strides in bytes (not elements).
Source§

fn raw_dtype(&self) -> DType

Runtime dtype descriptor.
Source§

fn is_c_contiguous(&self) -> bool

Whether the data is C-contiguous.
Source§

fn is_f_contiguous(&self) -> bool

Whether the data is Fortran-contiguous.
Source§

impl<T: Element, D: Dimension> AsType<D> for Array<T, D>

Available on crate feature std only.
Source§

fn astype<U: Element>(&self) -> FerrayResult<Array<U, D>>
where Self: AsTypeInner<U, D>,

Cast all elements to type U, returning a new array. Read more
Source§

impl<T, U, D> AsTypeInner<U, D> for Array<T, D>
where T: Element + PromoteTo<U>, U: Element, D: Dimension,

Available on crate feature std only.

Blanket implementation: any T that can PromoteTo can astype.

Source§

fn astype_inner(&self) -> FerrayResult<Array<U, D>>

Perform the cast.
Source§

impl<T: Element, D: Dimension> Clone for Array<T, D>

Source§

fn clone(&self) -> Self

Returns a duplicate 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<T: Element, D: Dimension> Debug for Array<T, D>

Source§

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

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

impl<T: Element, D: Dimension> Display for Array<T, D>

Source§

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

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

impl<T, D> Div<&Array<T, D>> for &Array<T, D>
where T: Element + Copy + Div<Output = T>, D: Dimension,

Source§

type Output = Result<Array<T, D>, FerrayError>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &Array<T, D>) -> Self::Output

Performs the / operation. Read more
Source§

impl<T, D> Div<&Array<T, D>> for Array<T, D>
where T: Element + Copy + Div<Output = T>, D: Dimension,

Source§

type Output = Result<Array<T, D>, FerrayError>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &Array<T, D>) -> Self::Output

Performs the / operation. Read more
Source§

impl<T, D> Div<Array<T, D>> for &Array<T, D>
where T: Element + Copy + Div<Output = T>, D: Dimension,

Source§

type Output = Result<Array<T, D>, FerrayError>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Array<T, D>) -> Self::Output

Performs the / operation. Read more
Source§

impl<T, D> Div<T> for &Array<T, D>
where T: Element + Copy + Div<Output = T>, D: Dimension,

Source§

type Output = Result<Array<T, D>, FerrayError>

The resulting type after applying the / operator.
Source§

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

Performs the / operation. Read more
Source§

impl<T, D> Div<T> for Array<T, D>
where T: Element + Copy + Div<Output = T>, D: Dimension,

Source§

type Output = Result<Array<T, D>, FerrayError>

The resulting type after applying the / operator.
Source§

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

Performs the / operation. Read more
Source§

impl<T, D> Div for Array<T, D>
where T: Element + Copy + Div<Output = T>, D: Dimension,

Source§

type Output = Result<Array<T, D>, FerrayError>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Array<T, D>) -> Self::Output

Performs the / operation. Read more
Source§

impl<T, D> DivAssign<T> for Array<T, D>
where T: Element + Copy + DivAssign, D: Dimension,

Source§

fn div_assign(&mut self, rhs: T)

Performs the /= operation. Read more
Source§

impl From<Array<Complex<f32>, IxDyn>> for DynArray

Source§

fn from(a: Array<Complex<f32>, IxDyn>) -> Self

Converts to this type from the input type.
Source§

impl From<Array<Complex<f64>, IxDyn>> for DynArray

Source§

fn from(a: Array<Complex<f64>, IxDyn>) -> Self

Converts to this type from the input type.
Source§

impl From<Array<I256, IxDyn>> for DynArray

Source§

fn from(a: Array<I256, IxDyn>) -> Self

Converts to this type from the input type.
Source§

impl<T: Element, D: Dimension> From<Array<T, D>> for ArcArray<T, D>

Source§

fn from(arr: Array<T, D>) -> Self

Converts to this type from the input type.
Source§

impl<T: Element, D: Dimension> From<Array<T, D>> for CowArray<'_, T, D>

Source§

fn from(arr: Array<T, D>) -> Self

Converts to this type from the input type.
Source§

impl From<Array<bool, IxDyn>> for DynArray

Source§

fn from(a: Array<bool, IxDyn>) -> Self

Converts to this type from the input type.
Source§

impl From<Array<f32, IxDyn>> for DynArray

Source§

fn from(a: Array<f32, IxDyn>) -> Self

Converts to this type from the input type.
Source§

impl From<Array<f64, IxDyn>> for DynArray

Source§

fn from(a: Array<f64, IxDyn>) -> Self

Converts to this type from the input type.
Source§

impl From<Array<i128, IxDyn>> for DynArray

Source§

fn from(a: Array<i128, IxDyn>) -> Self

Converts to this type from the input type.
Source§

impl From<Array<i16, IxDyn>> for DynArray

Source§

fn from(a: Array<i16, IxDyn>) -> Self

Converts to this type from the input type.
Source§

impl From<Array<i32, IxDyn>> for DynArray

Source§

fn from(a: Array<i32, IxDyn>) -> Self

Converts to this type from the input type.
Source§

impl From<Array<i64, IxDyn>> for DynArray

Source§

fn from(a: Array<i64, IxDyn>) -> Self

Converts to this type from the input type.
Source§

impl From<Array<i8, IxDyn>> for DynArray

Source§

fn from(a: Array<i8, IxDyn>) -> Self

Converts to this type from the input type.
Source§

impl From<Array<u128, IxDyn>> for DynArray

Source§

fn from(a: Array<u128, IxDyn>) -> Self

Converts to this type from the input type.
Source§

impl From<Array<u16, IxDyn>> for DynArray

Source§

fn from(a: Array<u16, IxDyn>) -> Self

Converts to this type from the input type.
Source§

impl From<Array<u32, IxDyn>> for DynArray

Source§

fn from(a: Array<u32, IxDyn>) -> Self

Converts to this type from the input type.
Source§

impl From<Array<u64, IxDyn>> for DynArray

Source§

fn from(a: Array<u64, IxDyn>) -> Self

Converts to this type from the input type.
Source§

impl From<Array<u8, IxDyn>> for DynArray

Source§

fn from(a: Array<u8, IxDyn>) -> Self

Converts to this type from the input type.
Source§

impl<T: Element> Index<&[usize]> for Array<T, IxDyn>

Source§

type Output = T

The returned type after indexing.
Source§

fn index(&self, idx: &[usize]) -> &T

Performs the indexing (container[index]) operation. Read more
Source§

impl<T: Element> Index<[usize; 1]> for Array<T, Ix1>

Source§

type Output = T

The returned type after indexing.
Source§

fn index(&self, idx: [usize; 1]) -> &T

Performs the indexing (container[index]) operation. Read more
Source§

impl<T: Element> Index<[usize; 2]> for Array<T, Ix2>

Source§

type Output = T

The returned type after indexing.
Source§

fn index(&self, idx: [usize; 2]) -> &T

Performs the indexing (container[index]) operation. Read more
Source§

impl<T: Element> Index<[usize; 3]> for Array<T, Ix3>

Source§

type Output = T

The returned type after indexing.
Source§

fn index(&self, idx: [usize; 3]) -> &T

Performs the indexing (container[index]) operation. Read more
Source§

impl<T: Element> Index<[usize; 4]> for Array<T, Ix4>

Source§

type Output = T

The returned type after indexing.
Source§

fn index(&self, idx: [usize; 4]) -> &T

Performs the indexing (container[index]) operation. Read more
Source§

impl<T: Element> Index<[usize; 5]> for Array<T, Ix5>

Source§

type Output = T

The returned type after indexing.
Source§

fn index(&self, idx: [usize; 5]) -> &T

Performs the indexing (container[index]) operation. Read more
Source§

impl<T: Element> Index<[usize; 6]> for Array<T, Ix6>

Source§

type Output = T

The returned type after indexing.
Source§

fn index(&self, idx: [usize; 6]) -> &T

Performs the indexing (container[index]) operation. Read more
Source§

impl<T: Element> IndexMut<&[usize]> for Array<T, IxDyn>

Source§

fn index_mut(&mut self, idx: &[usize]) -> &mut T

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl<T: Element> IndexMut<[usize; 1]> for Array<T, Ix1>

Source§

fn index_mut(&mut self, idx: [usize; 1]) -> &mut T

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl<T: Element> IndexMut<[usize; 2]> for Array<T, Ix2>

Source§

fn index_mut(&mut self, idx: [usize; 2]) -> &mut T

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl<T: Element> IndexMut<[usize; 3]> for Array<T, Ix3>

Source§

fn index_mut(&mut self, idx: [usize; 3]) -> &mut T

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl<T: Element> IndexMut<[usize; 4]> for Array<T, Ix4>

Source§

fn index_mut(&mut self, idx: [usize; 4]) -> &mut T

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl<T: Element> IndexMut<[usize; 5]> for Array<T, Ix5>

Source§

fn index_mut(&mut self, idx: [usize; 5]) -> &mut T

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl<T: Element> IndexMut<[usize; 6]> for Array<T, Ix6>

Source§

fn index_mut(&mut self, idx: [usize; 6]) -> &mut T

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl<'a, T: Element, D: Dimension> IntoIterator for &'a Array<T, D>

Source§

type Item = &'a T

The type of the elements being iterated over.
Source§

type IntoIter = Iter<'a, T, <D as Dimension>::NdarrayDim>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'a, T: Element, D: Dimension> IntoIterator for &'a mut Array<T, D>

Source§

type Item = &'a mut T

The type of the elements being iterated over.
Source§

type IntoIter = IterMut<'a, T, <D as Dimension>::NdarrayDim>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<T: Element, D: Dimension> IntoIterator for Array<T, D>

Source§

type Item = T

The type of the elements being iterated over.
Source§

type IntoIter = IntoIter<T, <D as Dimension>::NdarrayDim>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<T, D> Mul<&Array<T, D>> for &Array<T, D>
where T: Element + Copy + Mul<Output = T>, D: Dimension,

Source§

type Output = Result<Array<T, D>, FerrayError>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Array<T, D>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T, D> Mul<&Array<T, D>> for Array<T, D>
where T: Element + Copy + Mul<Output = T>, D: Dimension,

Source§

type Output = Result<Array<T, D>, FerrayError>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Array<T, D>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T, D> Mul<Array<T, D>> for &Array<T, D>
where T: Element + Copy + Mul<Output = T>, D: Dimension,

Source§

type Output = Result<Array<T, D>, FerrayError>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Array<T, D>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T, D> Mul<T> for &Array<T, D>
where T: Element + Copy + Mul<Output = T>, D: Dimension,

Source§

type Output = Result<Array<T, D>, FerrayError>

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl<T, D> Mul<T> for Array<T, D>
where T: Element + Copy + Mul<Output = T>, D: Dimension,

Source§

type Output = Result<Array<T, D>, FerrayError>

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl<T, D> Mul for Array<T, D>
where T: Element + Copy + Mul<Output = T>, D: Dimension,

Source§

type Output = Result<Array<T, D>, FerrayError>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Array<T, D>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T, D> MulAssign<T> for Array<T, D>
where T: Element + Copy + MulAssign, D: Dimension,

Source§

fn mul_assign(&mut self, rhs: T)

Performs the *= operation. Read more
Source§

impl<T, D> Neg for &Array<T, D>
where T: Element + Copy + Neg<Output = T>, D: Dimension,

Source§

type Output = Result<Array<T, D>, FerrayError>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<T, D> Neg for Array<T, D>
where T: Element + Copy + Neg<Output = T>, D: Dimension,

Source§

type Output = Result<Array<T, D>, FerrayError>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<T: Element + PartialEq, D: Dimension> PartialEq for Array<T, D>

Source§

fn eq(&self, other: &Self) -> 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<T, D> Rem<&Array<T, D>> for &Array<T, D>
where T: Element + Copy + Rem<Output = T>, D: Dimension,

Source§

type Output = Result<Array<T, D>, FerrayError>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &Array<T, D>) -> Self::Output

Performs the % operation. Read more
Source§

impl<T, D> Rem<&Array<T, D>> for Array<T, D>
where T: Element + Copy + Rem<Output = T>, D: Dimension,

Source§

type Output = Result<Array<T, D>, FerrayError>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &Array<T, D>) -> Self::Output

Performs the % operation. Read more
Source§

impl<T, D> Rem<Array<T, D>> for &Array<T, D>
where T: Element + Copy + Rem<Output = T>, D: Dimension,

Source§

type Output = Result<Array<T, D>, FerrayError>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: Array<T, D>) -> Self::Output

Performs the % operation. Read more
Source§

impl<T, D> Rem<T> for &Array<T, D>
where T: Element + Copy + Rem<Output = T>, D: Dimension,

Source§

type Output = Result<Array<T, D>, FerrayError>

The resulting type after applying the % operator.
Source§

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

Performs the % operation. Read more
Source§

impl<T, D> Rem<T> for Array<T, D>
where T: Element + Copy + Rem<Output = T>, D: Dimension,

Source§

type Output = Result<Array<T, D>, FerrayError>

The resulting type after applying the % operator.
Source§

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

Performs the % operation. Read more
Source§

impl<T, D> Rem for Array<T, D>
where T: Element + Copy + Rem<Output = T>, D: Dimension,

Source§

type Output = Result<Array<T, D>, FerrayError>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: Array<T, D>) -> Self::Output

Performs the % operation. Read more
Source§

impl<T, D> RemAssign<T> for Array<T, D>
where T: Element + Copy + RemAssign, D: Dimension,

Source§

fn rem_assign(&mut self, rhs: T)

Performs the %= operation. Read more
Source§

impl<T, D> Sub<&Array<T, D>> for &Array<T, D>
where T: Element + Copy + Sub<Output = T>, D: Dimension,

Source§

type Output = Result<Array<T, D>, FerrayError>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &Array<T, D>) -> Self::Output

Performs the - operation. Read more
Source§

impl<T, D> Sub<&Array<T, D>> for Array<T, D>
where T: Element + Copy + Sub<Output = T>, D: Dimension,

Source§

type Output = Result<Array<T, D>, FerrayError>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &Array<T, D>) -> Self::Output

Performs the - operation. Read more
Source§

impl<T, D> Sub<Array<T, D>> for &Array<T, D>
where T: Element + Copy + Sub<Output = T>, D: Dimension,

Source§

type Output = Result<Array<T, D>, FerrayError>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Array<T, D>) -> Self::Output

Performs the - operation. Read more
Source§

impl<T, D> Sub<T> for &Array<T, D>
where T: Element + Copy + Sub<Output = T>, D: Dimension,

Source§

type Output = Result<Array<T, D>, FerrayError>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: T) -> Self::Output

Performs the - operation. Read more
Source§

impl<T, D> Sub<T> for Array<T, D>
where T: Element + Copy + Sub<Output = T>, D: Dimension,

Source§

type Output = Result<Array<T, D>, FerrayError>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: T) -> Self::Output

Performs the - operation. Read more
Source§

impl<T, D> Sub for Array<T, D>
where T: Element + Copy + Sub<Output = T>, D: Dimension,

Source§

type Output = Result<Array<T, D>, FerrayError>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Array<T, D>) -> Self::Output

Performs the - operation. Read more
Source§

impl<T, D> SubAssign<T> for Array<T, D>
where T: Element + Copy + SubAssign, D: Dimension,

Source§

fn sub_assign(&mut self, rhs: T)

Performs the -= operation. Read more
Source§

impl<T: Element + Eq, D: Dimension> Eq for Array<T, D>

Auto Trait Implementations§

§

impl<T, D> Freeze for Array<T, D>
where D: Freeze, <D as Dimension>::NdarrayDim: Freeze,

§

impl<T, D> RefUnwindSafe for Array<T, D>

§

impl<T, D> Send for Array<T, D>

§

impl<T, D> Sync for Array<T, D>

§

impl<T, D> Unpin for Array<T, D>
where D: Unpin, <D as Dimension>::NdarrayDim: Unpin,

§

impl<T, D> UnsafeUnpin for Array<T, D>

§

impl<T, D> UnwindSafe for Array<T, D>

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, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.
Source§

impl<T, Rhs> NumAssignOps<Rhs> for T
where T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,

Source§

impl<T, Rhs, Output> NumOps<Rhs, Output> for T
where T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,