pub struct BpsvRow<'a> { /* private fields */ }
Expand description
A single row in a BPSV document with borrowed data
Implementations§
Source§impl<'a> BpsvRow<'a>
impl<'a> BpsvRow<'a>
Sourcepub fn from_typed_values(values: Vec<BpsvValue>) -> BpsvRow<'static>
pub fn from_typed_values(values: Vec<BpsvValue>) -> BpsvRow<'static>
Create a new row from typed values
Sourcepub fn get_raw_by_name(
&self,
field_name: &str,
schema: &BpsvSchema,
) -> Option<&str>
pub fn get_raw_by_name( &self, field_name: &str, schema: &BpsvSchema, ) -> Option<&str>
Get a raw string value by field name using the schema
Sourcepub fn raw_values(&self) -> &[&'a str]
pub fn raw_values(&self) -> &[&'a str]
Get all raw values
Sourcepub fn get_typed_values(&mut self, schema: &BpsvSchema) -> Result<&[BpsvValue]>
pub fn get_typed_values(&mut self, schema: &BpsvSchema) -> Result<&[BpsvValue]>
Parse and get typed values using the schema
Sourcepub fn get_typed(
&mut self,
index: usize,
schema: &BpsvSchema,
) -> Result<Option<&BpsvValue>>
pub fn get_typed( &mut self, index: usize, schema: &BpsvSchema, ) -> Result<Option<&BpsvValue>>
Get a typed value by index
Sourcepub fn get_typed_by_name(
&mut self,
field_name: &str,
schema: &BpsvSchema,
) -> Result<Option<&BpsvValue>>
pub fn get_typed_by_name( &mut self, field_name: &str, schema: &BpsvSchema, ) -> Result<Option<&BpsvValue>>
Get a typed value by field name
Sourcepub fn to_map(&self, schema: &BpsvSchema) -> Result<HashMap<String, String>>
pub fn to_map(&self, schema: &BpsvSchema) -> Result<HashMap<String, String>>
Convert row to a map of field names to raw values
Sourcepub fn to_typed_map(
&mut self,
schema: &BpsvSchema,
) -> Result<HashMap<String, BpsvValue>>
pub fn to_typed_map( &mut self, schema: &BpsvSchema, ) -> Result<HashMap<String, BpsvValue>>
Convert row to a map of field names to typed values
Sourcepub fn to_bpsv_line(&self) -> String
pub fn to_bpsv_line(&self) -> String
Convert to BPSV line format
Trait Implementations§
Source§impl BpsvRowOps for BpsvRow<'_>
impl BpsvRowOps for BpsvRow<'_>
Source§fn get_raw_by_name(&self, field_name: &str, schema: &BpsvSchema) -> Option<&str>
fn get_raw_by_name(&self, field_name: &str, schema: &BpsvSchema) -> Option<&str>
Get a raw string value by field name using the schema
impl<'a> StructuralPartialEq for BpsvRow<'a>
Auto Trait Implementations§
impl<'a> Freeze for BpsvRow<'a>
impl<'a> RefUnwindSafe for BpsvRow<'a>
impl<'a> Send for BpsvRow<'a>
impl<'a> Sync for BpsvRow<'a>
impl<'a> Unpin for BpsvRow<'a>
impl<'a> UnwindSafe for BpsvRow<'a>
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