pub struct Valid<T>(/* private fields */);Expand description
A struct which wraps a valid instance of some T.
The only way to create an instance of this struct is through the validate
function on the Unvalidated type. This ensures that if you have a Valid<T>,
it was definitely validated at some point. This is commonly referred to as the
typestate pattern.
Implementations§
Trait Implementations§
impl<T: Copy> Copy for Valid<T>
Auto Trait Implementations§
impl<T> Freeze for Valid<T>where
T: Freeze,
impl<T> RefUnwindSafe for Valid<T>where
T: RefUnwindSafe,
impl<T> Send for Valid<T>where
T: Send,
impl<T> Sync for Valid<T>where
T: Sync,
impl<T> Unpin for Valid<T>where
T: Unpin,
impl<T> UnwindSafe for Valid<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