pub struct Column { /* private fields */ }
Implementations§
Source§impl Column
impl Column
Sourcepub fn new(
table: impl ToString,
name: impl ToString,
datatype: SqlDatatype,
) -> Column
pub fn new( table: impl ToString, name: impl ToString, datatype: SqlDatatype, ) -> Column
Create a new column by supplying at minimum its name, type and table
Sourcepub fn set_default(&mut self, value: Option<DefaultValue>) -> &mut Column
pub fn set_default(&mut self, value: Option<DefaultValue>) -> &mut Column
Set an optional default value
Sourcepub fn datatype(&self) -> &SqlDatatype
pub fn datatype(&self) -> &SqlDatatype
Get datatype
Sourcepub fn datatype_json(&self) -> &JsonDatatype
pub fn datatype_json(&self) -> &JsonDatatype
Get JS/JSON datatype
Sourcepub fn datatype_rust(&self) -> &RustDatatype
pub fn datatype_rust(&self) -> &RustDatatype
Get rust datatype
Sourcepub fn default(&self) -> Option<DefaultValue>
pub fn default(&self) -> Option<DefaultValue>
Get default value if available
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Column
impl<'de> Deserialize<'de> for Column
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl WithMetadata for Column
impl WithMetadata for Column
Source§fn get_metadata_mut(&mut self) -> &mut HashMap<String, String>
fn get_metadata_mut(&mut self) -> &mut HashMap<String, String>
Borrow metadata container for writing
Source§fn set_meta(
&mut self,
meta_key: impl ToString,
meta_value: impl ToString,
) -> &mut Self
fn set_meta( &mut self, meta_key: impl ToString, meta_value: impl ToString, ) -> &mut Self
Set metadata key value pair
Source§fn set_meta_flag(&mut self, meta_flag: impl ToString) -> &mut Self
fn set_meta_flag(&mut self, meta_flag: impl ToString) -> &mut Self
Set metadata flag
impl StructuralPartialEq for Column
Auto Trait Implementations§
impl Freeze for Column
impl RefUnwindSafe for Column
impl Send for Column
impl Sync for Column
impl Unpin for Column
impl UnwindSafe for Column
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more