Struct query_structure::walkers::DefaultValueWalker
source · pub struct DefaultValueWalker<'db> { /* private fields */ }
Expand description
An @default()
attribute on a field.
Implementations§
source§impl<'db> DefaultValueWalker<'db>
impl<'db> DefaultValueWalker<'db>
sourcepub fn ast_attribute(self) -> &'db Attribute
pub fn ast_attribute(self) -> &'db Attribute
The AST node of the attribute.
sourcepub fn value(self) -> &'db Expression
pub fn value(self) -> &'db Expression
The value expression in the @default
attribute.
ⓘ
score Int @default(0)
^
sourcepub fn is_autoincrement(self) -> bool
pub fn is_autoincrement(self) -> bool
Is this an @default(autoincrement())
?
sourcepub fn is_dbgenerated(self) -> bool
pub fn is_dbgenerated(self) -> bool
Is this an @default(dbgenerated())
?
sourcepub fn is_sequence(self) -> bool
pub fn is_sequence(self) -> bool
Is this an @default(sequence())
?
sourcepub fn mapped_name(self) -> Option<&'db str>
pub fn mapped_name(self) -> Option<&'db str>
The mapped name of the default value. Not applicable to all connectors. See crate docs for details on mapped names.
ⓘ
name String @default("george", map: "name_default_to_george")
^^^^^^^^^^^^^^^^^^^^^^^^
sourcepub fn field(self) -> Walker<'db, ScalarFieldId>
pub fn field(self) -> Walker<'db, ScalarFieldId>
The field carrying the default attribute.
ⓘ
name String @default("george")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Trait Implementations§
source§impl<'db> Clone for DefaultValueWalker<'db>
impl<'db> Clone for DefaultValueWalker<'db>
source§fn clone(&self) -> DefaultValueWalker<'db>
fn clone(&self) -> DefaultValueWalker<'db>
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<'db> DefaultValueExt<'db> for DefaultValueWalker<'db>
impl<'db> DefaultValueExt<'db> for DefaultValueWalker<'db>
impl<'db> Copy for DefaultValueWalker<'db>
Auto Trait Implementations§
impl<'db> RefUnwindSafe for DefaultValueWalker<'db>
impl<'db> Send for DefaultValueWalker<'db>
impl<'db> Sync for DefaultValueWalker<'db>
impl<'db> Unpin for DefaultValueWalker<'db>
impl<'db> UnwindSafe for DefaultValueWalker<'db>
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