pub struct NonZero<T: Zero>(pub T);Expand description
A newtype which certifies the value is non-zero
Tuple Fieldsยง
ยง0: TImplementationsยง
Sourceยงimpl<T: Zero> NonZero<T>
impl<T: Zero> NonZero<T>
Sourcepub fn new(value: T) -> Option<Self>
pub fn new(value: T) -> Option<Self>
Certifies that value is nonzero.
Returns None when value is zero.
Sourcepub fn new_unchecked(value: T) -> Self
pub fn new_unchecked(value: T) -> Self
Constructs a certified nonzero value without checking the invariant.
Callers must establish by construction that value is not zero. This
is a logical unchecked constructor rather than an unsafe memory
operation; violating the invariant can nevertheless invalidate the
algebraic assumptions of DivRing and Field.
Trait Implementationsยง
impl<T: Copy + Zero> Copy for NonZero<T>
impl<T: Eq + Zero> Eq for NonZero<T>
Sourceยงimpl<T: Zero + One + Point> Group for NonZero<T>
impl<T: Zero + One + Point> Group for NonZero<T>
fn identity() -> Self
fn compose(&self, other: &Self) -> Self
fn inverse(&self) -> Self
fn check_left_identity(&self) -> boolwhere
Self: PartialEq,
fn check_right_identity(&self) -> boolwhere
Self: PartialEq,
fn check_associativity(a: Self, b: Self, c: Self) -> boolwhere
Self: PartialEq,
fn check_left_inverse(&self) -> bool
fn check_right_inverse(&self) -> boolwhere
Self: PartialEq,
Sourceยงimpl<R: Real> Interval for NonZero<Complex<R>>
impl<R: Real> Interval for NonZero<Complex<R>>
Sourceยงtype R = R
type R = R
The ordered field the interval is valued in โ the real field where
magnitudes, distances, and convergence live. Distinct from a scalar
fieldโs involution
Fixed: analysis happens here regardless of the
algebraic involution.Sourceยงfn interval_squared(&self, other: &Self) -> R
fn interval_squared(&self, other: &Self) -> R
Sourceยงfn interval(&self, other: &Self) -> Complex<Self::R>
fn interval(&self, other: &Self) -> Complex<Self::R>
Interval between self and other. Real or imaginary
carries causal character.
fn check_interval_symmetry(a: Self, b: Self) -> bool
fn check_self_interval_zero(a: Self) -> bool
fn check_interval_squared_agrees_with_interval(a: &Self, b: &Self) -> bool
Sourceยงimpl<R: Real> LieGroup<Coords<R, 2>> for NonZero<Complex<R>>
impl<R: Real> LieGroup<Coords<R, 2>> for NonZero<Complex<R>>
fn identity_exp(v: Coords<R, 2>) -> Self
fn identity_log(p: &Self) -> Option<Coords<R, 2>>
Sourceยงimpl<T: Ord + Zero> Ord for NonZero<T>
impl<T: Ord + Zero> Ord for NonZero<T>
1.21.0 (const: unstable) ยท Sourceยงfn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Sourceยงimpl<T: PartialOrd + Zero> PartialOrd for NonZero<T>
impl<T: PartialOrd + Zero> PartialOrd for NonZero<T>
impl<T: PartialEq + Zero> StructuralPartialEq for NonZero<T>
Auto Trait Implementationsยง
impl<T> Freeze for NonZero<T>where
T: Freeze,
impl<T> RefUnwindSafe for NonZero<T>where
T: RefUnwindSafe,
impl<T> Send for NonZero<T>where
T: Send,
impl<T> Sync for NonZero<T>where
T: Sync,
impl<T> Unpin for NonZero<T>where
T: Unpin,
impl<T> UnsafeUnpin for NonZero<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for NonZero<T>where
T: UnwindSafe,
Blanket Implementationsยง
Sourceยงimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Sourceยงfn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Sourceยงimpl<V, S> Chart<S, V> for S
impl<V, S> Chart<S, V> for S
Sourceยงtype Global = <S as Smooth<V>>::Global
type Global = <S as Smooth<V>>::Global
The result of mapping local coordinates back onto the manifold. Read more
fn to_local(&self, point: &S) -> Option<V>
fn to_global(&self, coord: V) -> <S as Smooth<V>>::Global
fn chart_at(p: &S) -> S
Sourceยงfn local_distance(&self, other: &P) -> Option<<V::F as Field>::Fixed>where
V: Euclidean,
fn local_distance(&self, other: &P) -> Option<<V::F as Field>::Fixed>where
V: Euclidean,
Calculates the distance between
self and other
in local coordinates, based at &self.fn check_local_inverse(p: &P) -> boolwhere
P: PartialEq,
Sourceยงimpl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Sourceยงimpl<๐, X> Equivalent<๐, X> for Xwhere
๐: Cat,
impl<๐, X> Equivalent<๐, X> for Xwhere
๐: Cat,
Sourceยงimpl<V, L> ExpMap<L, V> for L
impl<V, L> ExpMap<L, V> for L
fn base_point(&self) -> L
fn check_base_point_is_origin(&self) -> boolwhere
V: Form,
fn check_preservation_of_origin(&self) -> boolwhere
V: Form,
Sourceยงimpl<M> Monoid for M
impl<M> Monoid for M
fn check_left_identity(&self) -> boolwhere
Self: PartialEq,
fn check_right_identity(&self) -> boolwhere
Self: PartialEq,
fn check_associativity(a: Self, b: Self, c: Self) -> boolwhere
Self: PartialEq,
Sourceยงimpl<G> MulGroup for G
impl<G> MulGroup for G
fn check_left_inverse(&self) -> boolwhere
Self: PartialEq,
fn check_right_inverse(&self) -> boolwhere
Self: PartialEq,
Sourceยงimpl<T> OptionallyOption<T> for T
impl<T> OptionallyOption<T> for T
Sourceยงfn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Converts either permitted representation into
Option<T>. Read more