pub struct TypeInvariant {
pub name: String,
pub type_name: String,
pub predicate: String,
pub description: Option<String>,
}Expand description
A type-level invariant (Meyer’s class invariant).
Asserts a predicate that must hold for every instance of type_name
at every stable state — after construction and after every public method.
Fields§
§name: String§type_name: StringRust type name (e.g., ValidatedTensor).
predicate: StringRust boolean expression over self (e.g., !self.dims.is_empty()).
description: Option<String>Trait Implementations§
Source§impl Clone for TypeInvariant
impl Clone for TypeInvariant
Source§fn clone(&self) -> TypeInvariant
fn clone(&self) -> TypeInvariant
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 TypeInvariant
impl Debug for TypeInvariant
Source§impl<'de> Deserialize<'de> for TypeInvariant
impl<'de> Deserialize<'de> for TypeInvariant
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TypeInvariant
impl RefUnwindSafe for TypeInvariant
impl Send for TypeInvariant
impl Sync for TypeInvariant
impl Unpin for TypeInvariant
impl UnsafeUnpin for TypeInvariant
impl UnwindSafe for TypeInvariant
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