pub struct Record { /* private fields */ }Expand description
Type definition of a generic record. A .dbf file is composed of many records
Implementations§
Source§impl Record
impl Record
Sourcepub fn insert(
&mut self,
field_name: String,
value: FieldValue,
) -> Option<FieldValue>
pub fn insert( &mut self, field_name: String, value: FieldValue, ) -> Option<FieldValue>
Inserts a new value in the record, returning the old one if there was any
§Example
let mut record = dbase::Record::default();
record.insert("FirstName".to_owned(), dbase::FieldValue::Character(Some("Yoshi".to_owned())));Sourcepub fn get(&self, field_name: &str) -> Option<&FieldValue>
pub fn get(&self, field_name: &str) -> Option<&FieldValue>
Returns the FieldValue for the given field name
Sourcepub fn get_mut(&mut self, field_name: &str) -> Option<&mut FieldValue>
pub fn get_mut(&mut self, field_name: &str) -> Option<&mut FieldValue>
Returns the mutable FieldValue for the given field name
Sourcepub fn remove(&mut self, field_name: &str) -> Option<FieldValue>
pub fn remove(&mut self, field_name: &str) -> Option<FieldValue>
Removes the FieldValue for the given field name
Trait Implementations§
Source§impl From<HashMap<String, FieldValue>> for Record
impl From<HashMap<String, FieldValue>> for Record
Source§fn from(map: HashMap<String, FieldValue, RandomState>) -> Self
fn from(map: HashMap<String, FieldValue, RandomState>) -> Self
Converts to this type from the input type.
Source§impl IntoIterator for Record
impl IntoIterator for Record
Source§impl ReadableRecord for Record
impl ReadableRecord for Record
Source§fn read_using<Source, MemoSource>(
field_iterator: &mut FieldIterator<'_, Source, MemoSource>,
) -> Result<Self, FieldIOError>
fn read_using<Source, MemoSource>( field_iterator: &mut FieldIterator<'_, Source, MemoSource>, ) -> Result<Self, FieldIOError>
function to be implemented that returns a new instance of your type
using values read from the `FieldIterator’
Source§impl WritableRecord for Record
impl WritableRecord for Record
Source§fn write_using<'a, W: Write>(
&self,
field_writer: &mut FieldWriter<'a, W>,
) -> Result<(), FieldIOError>
fn write_using<'a, W: Write>( &self, field_writer: &mut FieldWriter<'a, W>, ) -> Result<(), FieldIOError>
Use the FieldWriter to write the fields of the record
impl StructuralPartialEq for Record
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