pub struct Valid<T: Document>(/* private fields */);Expand description
A wrapper type to indicate that the inner type is valid.
Implementations§
Source§impl<T: Document + Sync> Valid<T>
impl<T: Document + Sync> Valid<T>
Sourcepub async fn new<DB: DatabaseConnection + ContentActions<T> + Sync>(
val: T,
ctx: ValidationContext<'_, DB, T>,
) -> Result<Self, ValidationError>
pub async fn new<DB: DatabaseConnection + ContentActions<T> + Sync>( val: T, ctx: ValidationContext<'_, DB, T>, ) -> Result<Self, ValidationError>
Validates the input, then returns a Valid
§Errors
This function will return an error if validation fails.
pub fn inner(self) -> T
Trait Implementations§
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>
impl<T> Sync for Valid<T>where
T: Sync,
impl<T> Unpin for Valid<T>where
T: Unpin,
impl<T> UnsafeUnpin for Valid<T>where
T: UnsafeUnpin,
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