Struct svc_storage::resources::base::FieldDefinition
source · pub struct FieldDefinition {
pub field_type: Type,
/* private fields */
}
Expand description
Field definition struct defining field properties
Fields§
§field_type: Type
[PsqlFieldType
]
Implementations§
source§impl FieldDefinition
impl FieldDefinition
sourcepub fn new(field_type: PsqlFieldType, mandatory: bool) -> Self
pub fn new(field_type: PsqlFieldType, mandatory: bool) -> Self
Create a new FieldDefinition
with provided field_type and mandatory setting
sourcepub fn new_internal(field_type: PsqlFieldType, mandatory: bool) -> Self
pub fn new_internal(field_type: PsqlFieldType, mandatory: bool) -> Self
Create a new internal FieldDefinition
with provided field_type and mandatory setting
sourcepub fn new_read_only(field_type: PsqlFieldType, mandatory: bool) -> Self
pub fn new_read_only(field_type: PsqlFieldType, mandatory: bool) -> Self
Create a new read_only FieldDefinition
with provided field_type and mandatory setting
sourcepub fn is_mandatory(&self) -> bool
pub fn is_mandatory(&self) -> bool
Returns bool
mandatory
sourcepub fn is_internal(&self) -> bool
pub fn is_internal(&self) -> bool
Returns bool
internal
sourcepub fn is_read_only(&self) -> bool
pub fn is_read_only(&self) -> bool
Returns bool
internal
sourcepub fn has_default(&self) -> bool
pub fn has_default(&self) -> bool
Returns bool
true
if a default
value has been provided for this field and false
if not
sourcepub fn set_default(&mut self, default: String) -> Self
pub fn set_default(&mut self, default: String) -> Self
Sets the default
value using the given default String
sourcepub fn get_default(&self) -> String
pub fn get_default(&self) -> String
Gets the default
value for this field
The function will panic if no default has been set. It’s recommended to call
has_default
first, to determine if this function can be used or
not
Trait Implementations§
source§impl Clone for FieldDefinition
impl Clone for FieldDefinition
source§fn clone(&self) -> FieldDefinition
fn clone(&self) -> FieldDefinition
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 moreAuto Trait Implementations§
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
§impl<T> CloneAny for T
impl<T> CloneAny for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request