pub struct Row { /* private fields */ }
Implementations§
Source§impl Row
impl Row
pub fn new( columns: &Arc<Vec<Column>>, column_names: &Arc<HashMap<String, usize>>, values: Box<[Value]>, ) -> Row
pub fn columns(&self) -> &Arc<Vec<Column>>
pub fn column_names(&self) -> &Arc<HashMap<String, usize>>
Sourcepub fn get<T>(&self, name: &str) -> Result<T, IntoTypedError>where
T: DeserializeOwned,
pub fn get<T>(&self, name: &str) -> Result<T, IntoTypedError>where
T: DeserializeOwned,
Get a value by column name
§Errors
If the column name is not found, returns IntoTypedError::ColumnNotFound
Sourcepub fn get_opt<T>(&self, name: &str) -> Result<Option<T>, IntoTypedError>where
T: DeserializeOwned,
pub fn get_opt<T>(&self, name: &str) -> Result<Option<T>, IntoTypedError>where
T: DeserializeOwned,
Get a value by column name, returning None
if the value is null
§Errors
If the column name is not found, returns IntoTypedError::ColumnNotFound
Sourcepub fn get_by_index<T>(&self, index: usize) -> Result<T, IntoTypedError>where
T: DeserializeOwned,
pub fn get_by_index<T>(&self, index: usize) -> Result<T, IntoTypedError>where
T: DeserializeOwned,
Sourcepub fn get_by_index_opt<T>(
&self,
index: usize,
) -> Result<Option<T>, IntoTypedError>where
T: DeserializeOwned,
pub fn get_by_index_opt<T>(
&self,
index: usize,
) -> Result<Option<T>, IntoTypedError>where
T: DeserializeOwned,
Get a value by index, returning None
if the value is null
§Errors
If the index is out of bounds, returns IntoTypedError::ValueNotFound
pub fn values(&self) -> &[Value]
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn into_typed<T>(self) -> Result<T, IntoTypedError>where
T: FromRow,
pub fn into_typed<T>(self) -> Result<T, IntoTypedError>where
T: FromRow,
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Row
impl RefUnwindSafe for Row
impl Send for Row
impl Sync for Row
impl Unpin for Row
impl UnwindSafe for Row
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