pub struct RawRow(/* private fields */);Expand description
A row of raw data returned from the database by a query. Or an unstructured runtime-defined row to upload to the server.
Implementations§
Source§impl RawRow
impl RawRow
Sourcepub fn try_get<I: RowIndex, T: FromSql>(&mut self, index: I) -> Result<T>
pub fn try_get<I: RowIndex, T: FromSql>(&mut self, index: I) -> Result<T>
Like RawRow::get, but returns a Result rather than panicking.
§Errors
Returns an error if the index is out of bounds or if the value cannot be converted to the specified
§Panics
Shouldn’t panic, bounds checked
Sourcepub fn get<I: RowIndex, T: FromSql>(&mut self, index: I) -> T
pub fn get<I: RowIndex, T: FromSql>(&mut self, index: I) -> T
Deserializes a value from the row. The value can be specified either by its numeric index in the row, or by its column name.
§Panics
Panics if the index is out of bounds or if the value cannot be converted to the specified type.
Sourcepub fn try_set_typed(
&mut self,
name: &impl ToString,
type_: Option<Type>,
value: impl ToSql,
) -> Result<()>
pub fn try_set_typed( &mut self, name: &impl ToString, type_: Option<Type>, value: impl ToSql, ) -> Result<()>
Sourcepub fn try_set(&mut self, name: &impl ToString, value: impl ToSql) -> Result<()>
pub fn try_set(&mut self, name: &impl ToString, value: impl ToSql) -> Result<()>
Same as try_set_typed, but always infers the type
§Errors
Returns an error if type conversion fails.
Trait Implementations§
Source§impl Row for RawRow
impl Row for RawRow
Source§const COLUMN_COUNT: Option<usize> = None
const COLUMN_COUNT: Option<usize> = None
If
Some, serialize_row and deserialize_row MUST return this number of columnsSource§fn column_names() -> Option<Vec<Cow<'static, str>>>
fn column_names() -> Option<Vec<Cow<'static, str>>>
If
Some, serialize_row and deserialize_row MUST have these namesAuto Trait Implementations§
impl Freeze for RawRow
impl RefUnwindSafe for RawRow
impl Send for RawRow
impl Sync for RawRow
impl Unpin for RawRow
impl UnsafeUnpin for RawRow
impl UnwindSafe for RawRow
Blanket Implementations§
impl<T> Allocation for T
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