pub struct Table {
pub name: String,
pub columns: Vec<Column>,
pub description: Option<String>,
}Expand description
Table definition
Fields§
§name: StringTable name
columns: Vec<Column>Table columns
description: Option<String>Optional table description
Implementations§
Source§impl Table
impl Table
Sourcepub fn add_column(&mut self, column: Column) -> &mut Self
pub fn add_column(&mut self, column: Column) -> &mut Self
Add a column to the table
Sourcepub fn with_column(
self,
name: impl Into<String>,
data_type: impl Into<String>,
) -> Self
pub fn with_column( self, name: impl Into<String>, data_type: impl Into<String>, ) -> Self
Builder method to add a column with name and type
Sourcepub fn description(self, desc: impl Into<String>) -> Self
pub fn description(self, desc: impl Into<String>) -> Self
Set the description
Sourcepub fn get_column(&self, name: &str) -> Option<&Column>
pub fn get_column(&self, name: &str) -> Option<&Column>
Get a column by name
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Table
impl<'de> Deserialize<'de> for Table
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
Auto Trait Implementations§
impl Freeze for Table
impl RefUnwindSafe for Table
impl Send for Table
impl Sync for Table
impl Unpin for Table
impl UnwindSafe for Table
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)