pub struct Record {
pub table: String,
pub fields: Vec<RecordField>,
}Expand description
A DB record
Fields§
§table: StringTable name
fields: Vec<RecordField>Fields
Implementations§
Source§impl Record
impl Record
Sourcepub fn add_field(
&mut self,
id: &str,
primary: bool,
ty: Type,
value: Value,
) -> &mut Self
pub fn add_field( &mut self, id: &str, primary: bool, ty: Type, value: Value, ) -> &mut Self
Adds a field
Sourcepub fn schema(&self) -> TableSchema
pub fn schema(&self) -> TableSchema
Returns the TableSchema
Sourcepub fn fields(&self) -> Vec<&RecordField>
pub fn fields(&self) -> Vec<&RecordField>
Returns all the fields
Sourcepub fn primary_fields(&self) -> Vec<&RecordField>
pub fn primary_fields(&self) -> Vec<&RecordField>
Returns the primary fields
Sourcepub fn get_field(&self, id: &str) -> Option<&RecordField>
pub fn get_field(&self, id: &str) -> Option<&RecordField>
Returns a record field
Sourcepub fn remove_field(&mut self, id: &str) -> Option<RecordField>
pub fn remove_field(&mut self, id: &str) -> Option<RecordField>
Removes a record field and returns ir
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Record
impl RefUnwindSafe for Record
impl Send for Record
impl Sync for Record
impl Unpin for Record
impl UnwindSafe for Record
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