pub struct ShapeGuardContext { /* private fields */ }Expand description
AD context providing dimension resolution and guard recording.
§Examples
use tenferro_ops::ShapeGuardContext;
let ctx = ShapeGuardContext::default();
assert!(ctx.guards().is_empty());Implementations§
Source§impl ShapeGuardContext
impl ShapeGuardContext
Sourcepub fn guards(&self) -> &[ShapeGuard]
pub fn guards(&self) -> &[ShapeGuard]
Returns the guards recorded so far.
§Examples
use tenferro_ops::ShapeGuardContext;
let ctx = ShapeGuardContext::default();
assert_eq!(ctx.guards(), &[]);Sourcepub fn clear_guards(&mut self)
pub fn clear_guards(&mut self)
Clears all recorded guards.
§Examples
use tenferro_ops::ShapeGuardContext;
let mut ctx = ShapeGuardContext::default();
ctx.clear_guards();
assert!(ctx.guards().is_empty());Trait Implementations§
Source§impl Clone for ShapeGuardContext
impl Clone for ShapeGuardContext
Source§fn clone(&self) -> ShapeGuardContext
fn clone(&self) -> ShapeGuardContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ShapeGuardContext
impl Debug for ShapeGuardContext
Source§impl Default for ShapeGuardContext
impl Default for ShapeGuardContext
Source§fn default() -> ShapeGuardContext
fn default() -> ShapeGuardContext
Returns the “default value” for a type. Read more
Source§impl PartialEq for ShapeGuardContext
impl PartialEq for ShapeGuardContext
impl Eq for ShapeGuardContext
impl StructuralPartialEq for ShapeGuardContext
Auto Trait Implementations§
impl Freeze for ShapeGuardContext
impl RefUnwindSafe for ShapeGuardContext
impl Send for ShapeGuardContext
impl Sync for ShapeGuardContext
impl Unpin for ShapeGuardContext
impl UnsafeUnpin for ShapeGuardContext
impl UnwindSafe for ShapeGuardContext
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> Twhere
Self: Distribution<T>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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