Enum query_structure::DefaultKind
source · pub enum DefaultKind {
Single(PrismaValue),
Expression(ValueGenerator),
}
Expand description
Represents a default specified on a field.
Variants§
Single(PrismaValue)
a static value, e.g. @default(1)
Expression(ValueGenerator)
a dynamic value, e.g. @default(uuid())
Implementations§
source§impl DefaultKind
impl DefaultKind
sourcepub fn is_autoincrement(&self) -> bool
pub fn is_autoincrement(&self) -> bool
Does this match @default(autoincrement())?
sourcepub fn is_dbgenerated(&self) -> bool
pub fn is_dbgenerated(&self) -> bool
Does this match @default(dbgenerated(_))?
pub fn unwrap_single(self) -> PrismaValue
pub fn to_dbgenerated_func(&self) -> Option<String>
sourcepub fn get(&self) -> Option<PrismaValue>
pub fn get(&self) -> Option<PrismaValue>
Returns either a copy of the contained single value or produces a new value as defined by the expression.
Trait Implementations§
source§impl Clone for DefaultKind
impl Clone for DefaultKind
source§fn clone(&self) -> DefaultKind
fn clone(&self) -> DefaultKind
Returns a copy 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 DefaultKind
impl Debug for DefaultKind
source§impl PartialEq for DefaultKind
impl PartialEq for DefaultKind
source§fn eq(&self, other: &DefaultKind) -> bool
fn eq(&self, other: &DefaultKind) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for DefaultKind
Auto Trait Implementations§
impl RefUnwindSafe for DefaultKind
impl Send for DefaultKind
impl Sync for DefaultKind
impl Unpin for DefaultKind
impl UnwindSafe for DefaultKind
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