Skip to main content

AnyScalar

Struct AnyScalar 

Source
pub struct AnyScalar { /* private fields */ }
Expand description

Dynamic scalar compatibility wrapper for tensor4all-core. This owns a rank-0 IdxTensor so that scalar values can participate in the same eager autodiff graph as tensors while preserving the existing dynamic scalar API shape. The infallible scalar constructors retain a tensor-initialization failure for later fallible tensor or AD operations. Infallible arithmetic also retains typed backend diagnostics and the tracked-state marker when an eager operation fails.

Implementations§

Source§

impl AnyScalar

Source

pub fn from_value<T: ScalarTensorElement>(value: T) -> Self

Creates an AnyScalar from a tensor element.

Use this when you already have a scalar value that implements TensorElement and want to lift it into the dynamic scalar wrapper.

§Arguments
  • value - The scalar value to wrap.
§Returns

A rank-0 AnyScalar containing value. The supported scalar types are f32, f64, Complex32, and Complex64; the dtype is retained without promotion.

Tensor initialization is attempted eagerly. Because this constructor is infallible, an initialization failure is retained and returned by later tensor- or AD-dependent operations such as AnyScalar::enable_grad. Value-only accessors and non-AD arithmetic remain available.

§Examples
use tensor4all_core::AnyScalar;

let scalar = AnyScalar::from_value(3.0f64);
assert_eq!(scalar.real(), 3.0);
assert!(scalar.is_real());
Source

pub fn from_real(x: f64) -> Self

Creates a real-valued AnyScalar.

This is a convenience wrapper around AnyScalar::from_value.

§Arguments
  • x - The real scalar value to wrap.
§Returns

A rank-0 AnyScalar with real dtype.

§Examples
use tensor4all_core::AnyScalar;

let scalar = AnyScalar::from_real(1.25);
assert_eq!(scalar.as_f64(), Some(1.25));
assert!(scalar.is_real());
Source

pub fn from_complex(re: f64, im: f64) -> Self

Creates a complex-valued AnyScalar.

This is a convenience wrapper around AnyScalar::from_value.

§Arguments
  • re - The real part of the complex value.
  • im - The imaginary part of the complex value.
§Returns

A rank-0 AnyScalar containing the requested complex number.

§Examples
use tensor4all_core::AnyScalar;

let scalar = AnyScalar::from_complex(1.0, -2.0);
assert_eq!(scalar.as_c64().map(|z| (z.re, z.im)), Some((1.0, -2.0)));
assert!(scalar.is_complex());
Source

pub fn new_real(x: f64) -> Self

Creates a real-valued AnyScalar.

This is an alias for AnyScalar::from_real.

§Arguments
  • x - The real scalar value to wrap.
§Returns

A rank-0 AnyScalar with real dtype.

§Examples
use tensor4all_core::AnyScalar;

let scalar = AnyScalar::new_real(2.5);
assert_eq!(scalar.real(), 2.5);
assert!(scalar.is_real());
Source

pub fn new_complex(re: f64, im: f64) -> Self

Creates a complex-valued AnyScalar.

This is an alias for AnyScalar::from_complex.

§Arguments
  • re - The real part of the complex value.
  • im - The imaginary part of the complex value.
§Returns

A rank-0 AnyScalar containing the requested complex number.

§Examples
use tensor4all_core::AnyScalar;

let scalar = AnyScalar::new_complex(2.0, 3.0);
assert_eq!(scalar.as_c64().map(|z| (z.re, z.im)), Some((2.0, 3.0)));
assert!(scalar.is_complex());
Source

pub fn primal(&self) -> Result<Self, AnyScalarError>

Returns the detached primal value of this scalar.

This is an alias for AnyScalar::detach.

§Returns

A scalar with the same value and no gradient tracking.

§Errors

Returns an error when the scalar is not a tracked leaf (a missing-graph /// failure).

§Examples
use tensor4all_core::AnyScalar;

let primal = AnyScalar::new_real(5.0).enable_grad().unwrap().primal().unwrap();
assert_eq!(primal.real(), 5.0);
assert!(!primal.tracks_grad());
Source

pub fn enable_grad(self) -> Result<Self, AnyScalarError>

Enables gradient tracking for this scalar.

§Returns

A new scalar that shares the same value but participates in autodiff.

§Errors

Returns the original tensor-initialization diagnostic if this scalar’s eager backend tensor could not be created, or propagates an AD runtime failure while enabling gradients.

§Examples
use tensor4all_core::AnyScalar;

let scalar = AnyScalar::new_real(2.0).enable_grad().unwrap();
assert!(scalar.tracks_grad());
Source

pub fn tracks_grad(&self) -> bool

Returns whether this scalar tracks gradients.

§Returns

true when the scalar participates in autodiff or retains a failed tracked operation, otherwise false.

§Examples
use tensor4all_core::AnyScalar;

let scalar = AnyScalar::new_real(1.0);
assert!(!scalar.tracks_grad());
Source

pub fn grad(&self) -> Result<Option<Self>, AnyScalarError>

Returns the stored gradient, if any.

§Returns

Ok(Some(_)) when a gradient is available, Ok(None) when no gradient has been recorded, or an error if the backend cannot read it.

§Errors

Returns an error when the scalar is not a tracked leaf or the gradient is /// unavailable (a missing-graph or dtype mismatch failure).

§Examples
use tensor4all_core::AnyScalar;

let x = AnyScalar::new_real(2.0).enable_grad().unwrap();
let y = &x * &x;
y.backward().unwrap();

let grad = x.grad().unwrap().unwrap();
assert_eq!(grad.real(), 4.0);
Source

pub fn clear_grad(&self) -> Result<(), AnyScalarError>

Clears the stored gradient for this scalar.

§Returns

Ok(()) when the gradient buffer was cleared successfully.

§Errors

Returns an error when the scalar is not a tracked leaf (a missing-graph /// failure).

§Examples
use tensor4all_core::AnyScalar;

let x = AnyScalar::new_real(2.0).enable_grad().unwrap();
let y = &x * &x;
y.backward().unwrap();
assert!(x.grad().unwrap().is_some());

x.clear_grad().unwrap();
assert!(x.grad().unwrap().is_none());
Source

pub fn backward(&self) -> Result<(), AnyScalarError>

Runs reverse-mode autodiff starting from this scalar.

§Returns

Ok(()) when gradients were accumulated successfully.

§Errors

Returns an error when the scalar is not a scalar-valued leaf or the reverse /// pass fails (a graph failure).

§Examples
use tensor4all_core::AnyScalar;

let x = AnyScalar::new_real(2.0).enable_grad().unwrap();
let y = &x * &x;
y.backward().unwrap();

let grad = x.grad().unwrap().unwrap();
assert_eq!(grad.real(), 4.0);
Source

pub fn detach(&self) -> Result<Self, AnyScalarError>

Returns a detached copy of this scalar.

§Returns

A scalar with the same value but without gradient tracking.

§Errors

Returns an error when the scalar is not a tracked leaf (a missing-graph /// failure).

§Examples
use tensor4all_core::AnyScalar;

let detached = AnyScalar::new_real(7.0)
    .enable_grad()
    .unwrap()
    .detach()
    .unwrap();
assert_eq!(detached.real(), 7.0);
assert!(!detached.tracks_grad());
Source

pub fn real(&self) -> f64

Returns the real part of this scalar.

§Returns

The real component as an f64, regardless of the underlying storage type.

§Examples
use tensor4all_core::AnyScalar;

let scalar = AnyScalar::new_complex(3.0, -4.0);
assert_eq!(scalar.real(), 3.0);
Source

pub fn imag(&self) -> f64

Returns the imaginary part of this scalar.

§Returns

The imaginary component as an f64. Real-valued scalars return 0.0.

§Examples
use tensor4all_core::AnyScalar;

let scalar = AnyScalar::new_complex(3.0, -4.0);
assert_eq!(scalar.imag(), -4.0);
Source

pub fn abs(&self) -> f64

Returns the magnitude of this scalar.

§Returns

The absolute value for real scalars or the complex norm for complex scalars.

§Examples
use tensor4all_core::AnyScalar;

let scalar = AnyScalar::new_complex(3.0, -4.0);
assert_eq!(scalar.abs(), 5.0);
Source

pub fn is_complex(&self) -> bool

Returns whether this scalar is complex-valued.

§Returns

true for complex dtypes and false for real or integer dtypes.

§Examples
use tensor4all_core::AnyScalar;

assert!(AnyScalar::new_complex(1.0, 2.0).is_complex());
assert!(!AnyScalar::new_real(1.0).is_complex());
Source

pub fn is_real(&self) -> bool

Returns whether this scalar is real-valued.

§Returns

true when the scalar is not complex-valued.

§Examples
use tensor4all_core::AnyScalar;

assert!(AnyScalar::new_real(1.0).is_real());
assert!(!AnyScalar::new_complex(1.0, 2.0).is_real());
Source

pub fn is_zero(&self) -> bool

Returns whether this scalar is exactly zero.

§Returns

true for exact zeros and false for any nonzero value.

§Examples
use tensor4all_core::AnyScalar;

assert!(AnyScalar::new_real(0.0).is_zero());
assert!(!AnyScalar::new_complex(0.0, 1.0).is_zero());
Source

pub fn as_f64(&self) -> Option<f64>

Returns this scalar as an f64 when it is real-valued.

§Returns

Some(value) for real and integer scalars, or None for complex scalars.

§Examples
use tensor4all_core::AnyScalar;

assert_eq!(AnyScalar::new_real(2.5).as_f64(), Some(2.5));
assert_eq!(AnyScalar::new_complex(2.5, 1.0).as_f64(), None);
Source

pub fn as_c64(&self) -> Option<Complex64>

Returns this scalar as a Complex64 when it is complex-valued.

§Returns

Some(value) for complex scalars or None for real and integer scalars.

§Examples
use tensor4all_core::AnyScalar;

let scalar = AnyScalar::new_complex(2.5, 1.0);
assert_eq!(scalar.as_c64().map(|z| (z.re, z.im)), Some((2.5, 1.0)));
assert_eq!(AnyScalar::new_real(2.5).as_c64(), None);
Source

pub fn try_conj(&self) -> Result<Self, AnyScalarError>

Returns the complex conjugate of this scalar.

§Returns

The conjugated scalar. Real-valued inputs are returned unchanged.

§Errors

Returns an error when the conjugation fails (a dtype mismatch or backend /// failure).

§Examples
use tensor4all_core::AnyScalar;

let scalar = AnyScalar::new_complex(3.0, -4.0).conj();
assert_eq!(scalar.as_c64().map(|z| (z.re, z.im)), Some((3.0, 4.0)));
Source

pub fn conj(&self) -> Self

Returns the complex conjugate of this scalar.

Source

pub fn real_part(&self) -> Self

Returns the real part as a real-valued scalar.

§Returns

A real-valued scalar containing the real component of self.

§Examples
use tensor4all_core::AnyScalar;

let scalar = AnyScalar::new_complex(3.0, -4.0).real_part();
assert_eq!(scalar.real(), 3.0);
assert!(scalar.is_real());
Source

pub fn imag_part(&self) -> Self

Returns the imaginary part as a real-valued scalar.

§Returns

A real-valued scalar containing the imaginary component of self.

§Examples
use tensor4all_core::AnyScalar;

let scalar = AnyScalar::new_complex(3.0, -4.0).imag_part();
assert_eq!(scalar.real(), -4.0);
assert!(scalar.is_real());
Source

pub fn compose_complex(real: Self, imag: Self) -> Result<Self, AnyScalarError>

Combines two real-valued scalars into a complex scalar.

§Arguments
  • real - The real component.
  • imag - The imaginary component.
§Returns

A complex AnyScalar whose real and imaginary parts come from the inputs.

§Errors

Returns an error when the components cannot be composed (a dtype mismatch or a backend failure).

§Examples
use tensor4all_core::AnyScalar;

let scalar = AnyScalar::compose_complex(
    AnyScalar::new_real(3.0),
    AnyScalar::new_real(-4.0),
)
.unwrap();
assert_eq!(scalar.as_c64().map(|z| (z.re, z.im)), Some((3.0, -4.0)));
Source

pub fn sqrt(&self) -> Self

Returns the square root of this scalar.

§Returns

The principal square root. Negative real inputs and complex inputs use complex arithmetic.

§Examples
use tensor4all_core::AnyScalar;

let scalar = AnyScalar::new_real(9.0).sqrt();
assert_eq!(scalar.real(), 3.0);
assert!(scalar.is_real());
Source

pub fn powf(&self, exponent: f64) -> Self

Raises this scalar to a floating-point power.

§Arguments
  • exponent - The exponent to apply.
§Returns

The value of self^exponent.

§Examples
use tensor4all_core::AnyScalar;

let scalar = AnyScalar::new_real(2.0).powf(3.0);
assert_eq!(scalar.real(), 8.0);
Source

pub fn powi(&self, exponent: i32) -> Self

Raises this scalar to an integer power.

§Arguments
  • exponent - The integer exponent to apply. Negative exponents return

    the reciprocal power.

§Returns

The value of self^exponent. Zero exponents return 1.

§Examples
use tensor4all_core::AnyScalar;

assert_eq!(AnyScalar::new_real(2.0).powi(3).real(), 8.0);
assert_eq!(AnyScalar::new_real(2.0).powi(-1).real(), 0.5);

Trait Implementations§

Source§

impl Add for AnyScalar

Source§

type Output = AnyScalar

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl Add<&AnyScalar> for &AnyScalar

Source§

type Output = AnyScalar

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl Add<&AnyScalar> for AnyScalar

Source§

type Output = AnyScalar

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl Add<AnyScalar> for &AnyScalar

Source§

type Output = AnyScalar

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl Clone for AnyScalar

Source§

fn clone(&self) -> AnyScalar

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for AnyScalar

Source§

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

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

impl Default for AnyScalar

Source§

fn default() -> Self

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

impl Display for AnyScalar

Source§

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

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

impl Div for AnyScalar

Source§

type Output = AnyScalar

The resulting type after applying the / operator.
Source§

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

Performs the / operation. Read more
Source§

impl Div<&AnyScalar> for &AnyScalar

Source§

type Output = AnyScalar

The resulting type after applying the / operator.
Source§

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

Performs the / operation. Read more
Source§

impl Div<&AnyScalar> for AnyScalar

Source§

type Output = AnyScalar

The resulting type after applying the / operator.
Source§

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

Performs the / operation. Read more
Source§

impl Div<AnyScalar> for &AnyScalar

Source§

type Output = AnyScalar

The resulting type after applying the / operator.
Source§

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

Performs the / operation. Read more
Source§

impl Div<AnyScalar> for Complex64

Source§

type Output = AnyScalar

The resulting type after applying the / operator.
Source§

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

Performs the / operation. Read more
Source§

impl From<AnyScalar> for Complex64

Source§

fn from(value: AnyScalar) -> Self

Converts to this type from the input type.
Source§

impl From<Complex<f32>> for AnyScalar

Source§

fn from(value: Complex32) -> Self

Converts to this type from the input type.
Source§

impl From<Complex<f64>> for AnyScalar

Source§

fn from(value: Complex64) -> Self

Converts to this type from the input type.
Source§

impl From<f32> for AnyScalar

Source§

fn from(value: f32) -> Self

Converts to this type from the input type.
Source§

impl From<f64> for AnyScalar

Source§

fn from(value: f64) -> Self

Converts to this type from the input type.
Source§

impl Mul for AnyScalar

Source§

type Output = AnyScalar

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl Mul<&AnyScalar> for &AnyScalar

Source§

type Output = AnyScalar

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl Mul<&AnyScalar> for AnyScalar

Source§

type Output = AnyScalar

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl Mul<AnyScalar> for &AnyScalar

Source§

type Output = AnyScalar

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl Mul<AnyScalar> for f64

Source§

type Output = AnyScalar

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl Mul<AnyScalar> for Complex64

Source§

type Output = AnyScalar

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl Neg for &AnyScalar

Source§

type Output = AnyScalar

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl Neg for AnyScalar

Source§

type Output = AnyScalar

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl One for AnyScalar

Source§

fn one() -> Self

Returns the multiplicative identity element of Self, 1. Read more
Source§

fn set_one(&mut self)

Sets self to the multiplicative identity element of Self, 1.
Source§

fn is_one(&self) -> bool
where Self: PartialEq,

Returns true if self is equal to the multiplicative identity. Read more
Source§

impl PartialEq for AnyScalar

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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 PartialOrd for AnyScalar

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 Sub for AnyScalar

Source§

type Output = AnyScalar

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl Sub<&AnyScalar> for &AnyScalar

Source§

type Output = AnyScalar

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl Sub<&AnyScalar> for AnyScalar

Source§

type Output = AnyScalar

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl Sub<AnyScalar> for &AnyScalar

Source§

type Output = AnyScalar

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl SumFromStorage for AnyScalar

Source§

fn sum_from_storage(storage: &Storage) -> Self

Compute the sum of all elements in the storage.
Source§

impl TryFrom<AnyScalar> for f64

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_from(value: AnyScalar) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl Zero for AnyScalar

Source§

fn zero() -> Self

Returns the additive identity element of Self, 0. Read more
Source§

fn is_zero(&self) -> bool

Returns true if self is equal to the additive identity.
Source§

fn set_zero(&mut self)

Sets self to the additive identity element of Self, 0.

Auto Trait Implementations§

Blanket Implementations§

§

impl<Rhs, Lhs, Output> AddByRef<Rhs> for Lhs
where &'a Lhs: for<'a> Add<&'a Rhs, Output = Output>,

§

type Output = Output

§

fn add_by_ref(&self, rhs: &Rhs) -> <Lhs as AddByRef<Rhs>>::Output

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<U> As for U

§

fn as_<T>(self) -> T
where T: CastFrom<U>, U: Sized,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. 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
§

impl<T> ByRef<T> for T

§

fn by_ref(&self) -> &T

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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
§

impl<Rhs, Lhs, Output> DivByRef<Rhs> for Lhs
where &'a Lhs: for<'a> Div<&'a Rhs, Output = Output>,

§

type Output = Output

§

fn div_by_ref(&self, rhs: &Rhs) -> <Lhs as DivByRef<Rhs>>::Output

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,

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

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> MaybeSend for T
where T: Send,

§

impl<T> MaybeSendSync for T
where T: Send + Sync,

§

impl<T> MaybeSync for T
where T: Sync,

Source§

impl<M> Measure for M
where M: Debug + PartialOrd + Add<Output = M> + Default + Clone,

§

impl<Rhs, Lhs, Output> MulByRef<Rhs> for Lhs
where &'a Lhs: for<'a> Mul<&'a Rhs, Output = Output>,

§

type Output = Output

§

fn mul_by_ref(&self, rhs: &Rhs) -> <Lhs as MulByRef<Rhs>>::Output

§

impl<T, Output> NegByRef for T
where &'a T: for<'a> Neg<Output = Output>,

§

type Output = Output

§

fn neg_by_ref(&self) -> <T as NegByRef>::Output

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

§

impl<Rhs, Lhs, Output> SubByRef<Rhs> for Lhs
where &'a Lhs: for<'a> Sub<&'a Rhs, Output = Output>,

§

type Output = Output

§

fn sub_by_ref(&self, rhs: &Rhs) -> <Lhs as SubByRef<Rhs>>::Output

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V