pub enum DefaultSource {
FromTrait,
Custom(DefaultInPlaceFn),
}Expand description
Source of a field’s default value.
Used by the #[facet(default)] attribute.
Variants§
FromTrait
Use the type’s Default trait via shape vtable.
Set when #[facet(default)] is used without an expression.
Custom(DefaultInPlaceFn)
Custom default expression wrapped in a function.
Set when #[facet(default = expr)] is used.
Trait Implementations§
Source§impl Clone for DefaultSource
impl Clone for DefaultSource
Source§fn clone(&self) -> DefaultSource
fn clone(&self) -> DefaultSource
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 DefaultSource
impl Debug for DefaultSource
impl Copy for DefaultSource
Auto Trait Implementations§
impl Freeze for DefaultSource
impl RefUnwindSafe for DefaultSource
impl Send for DefaultSource
impl Sync for DefaultSource
impl Unpin for DefaultSource
impl UnwindSafe for DefaultSource
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