pub struct Field { /* private fields */ }Expand description
Represents a field contained within some ent
Implementations§
Source§impl Field
impl Field
Sourcepub fn new<N: Into<String>, V: ValueLike>(name: N, value: V) -> Self
pub fn new<N: Into<String>, V: ValueLike>(name: N, value: V) -> Self
Creates a new field with the given name and value and no attributes
Sourcepub fn new_with_attributes<N: Into<String>, V: ValueLike, A: IntoIterator<Item = FieldAttribute>>(
name: N,
value: V,
attributes: A,
) -> Self
pub fn new_with_attributes<N: Into<String>, V: ValueLike, A: IntoIterator<Item = FieldAttribute>>( name: N, value: V, attributes: A, ) -> Self
Creates a new field with the given name, value, and attributes
Sourcepub fn into_value(self) -> Value
pub fn into_value(self) -> Value
Converts field into its value
Sourcepub fn to_value_type(&self) -> ValueType
pub fn to_value_type(&self) -> ValueType
The type of the value associated with the field
Sourcepub fn attributes(&self) -> &[FieldAttribute]
pub fn attributes(&self) -> &[FieldAttribute]
The attributes associated with the field
Sourcepub fn is_indexed(&self) -> bool
pub fn is_indexed(&self) -> bool
Returns true if this field is marked as indexed (used in databases)
Sourcepub fn is_immutable(&self) -> bool
pub fn is_immutable(&self) -> bool
Returns true if this field marked as immutable 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<'a> From<&'a Field> for FieldDefinition
impl<'a> From<&'a Field> for FieldDefinition
Source§impl From<Field> for FieldDefinition
impl From<Field> for FieldDefinition
impl Eq for Field
impl StructuralPartialEq for Field
Auto Trait Implementations§
impl Freeze for Field
impl RefUnwindSafe for Field
impl Send for Field
impl Sync for Field
impl Unpin for Field
impl UnwindSafe for Field
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