pub struct CollectionSchema<T> { /* private fields */ }Implementations§
Source§impl<T> CollectionSchema<T>
impl<T> CollectionSchema<T>
pub fn new(version: u32) -> Self
pub fn version(&self) -> u32
pub fn with_defaults( self, defaults: impl Fn(&T) -> T + Send + Sync + 'static, ) -> Self
pub fn with_normalize( self, normalize: impl Fn(&T) -> T + Send + Sync + 'static, ) -> Self
pub fn with_validate( self, validate: impl Fn(&T) -> Result<(), CollectionError> + Send + Sync + 'static, ) -> Self
pub fn with_migrate_from<Raw: 'static>( self, migrate: impl Fn(Raw, u32) -> Result<T, CollectionError> + Send + Sync + 'static, ) -> Self
Trait Implementations§
Source§impl<T: Clone> Clone for CollectionSchema<T>
impl<T: Clone> Clone for CollectionSchema<T>
Source§fn clone(&self) -> CollectionSchema<T>
fn clone(&self) -> CollectionSchema<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<T> Freeze for CollectionSchema<T>
impl<T> !RefUnwindSafe for CollectionSchema<T>
impl<T> Send for CollectionSchema<T>
impl<T> Sync for CollectionSchema<T>
impl<T> Unpin for CollectionSchema<T>
impl<T> UnsafeUnpin for CollectionSchema<T>
impl<T> !UnwindSafe for CollectionSchema<T>
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