pub struct FieldDefinition { /* private fields */ }Expand description
Represents a definition of a field, which is comprised of its name, type of value, and any associated attributes
Implementations§
Source§impl FieldDefinition
impl FieldDefinition
Sourcepub fn new<N: Into<String>, T: Into<ValueType>>(name: N, type: T) -> Self
pub fn new<N: Into<String>, T: Into<ValueType>>(name: N, type: T) -> Self
Creates a new field definition with the given name and value and no attributes
Sourcepub fn new_with_attributes<N: Into<String>, T: Into<ValueType>, A: IntoIterator<Item = FieldAttribute>>(
name: N,
type: T,
attributes: A,
) -> Self
pub fn new_with_attributes<N: Into<String>, T: Into<ValueType>, A: IntoIterator<Item = FieldAttribute>>( name: N, type: T, attributes: A, ) -> Self
Creates a new field definition with the given name, value, and attributes
Sourcepub fn attributes(&self) -> &[FieldAttribute]
pub fn attributes(&self) -> &[FieldAttribute]
The attributes associated with the field tied to the definition
Sourcepub fn is_indexed(&self) -> bool
pub fn is_indexed(&self) -> bool
Returns true if this field is marked as indexed (used in databases) in its definition
Sourcepub fn is_immutable(&self) -> bool
pub fn is_immutable(&self) -> bool
Returns true if this field marked as immutable in its definition and should not be updated
Sourcepub fn is_computed(&self) -> bool
pub fn is_computed(&self) -> bool
Returns true if this field marked as computed
Trait Implementations§
Source§impl Clone for FieldDefinition
impl Clone for FieldDefinition
Source§fn clone(&self) -> FieldDefinition
fn clone(&self) -> FieldDefinition
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 FieldDefinition
impl Debug for FieldDefinition
Source§impl<'a> From<&'a Field> for FieldDefinition
impl<'a> From<&'a Field> for FieldDefinition
Source§impl From<Field> for FieldDefinition
impl From<Field> for FieldDefinition
Source§impl PartialEq for FieldDefinition
impl PartialEq for FieldDefinition
impl Eq for FieldDefinition
impl StructuralPartialEq for FieldDefinition
Auto Trait Implementations§
impl Freeze for FieldDefinition
impl RefUnwindSafe for FieldDefinition
impl Send for FieldDefinition
impl Sync for FieldDefinition
impl Unpin for FieldDefinition
impl UnwindSafe for FieldDefinition
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