Struct holochain_state::query::prelude::Row
[−]pub struct Row<'stmt> { /* private fields */ }
Expand description
A single result row of a query.
Implementations
impl<'stmt> Row<'stmt>
impl<'stmt> Row<'stmt>
pub fn get_unwrap<I, T>(&self, idx: I) -> T where
I: RowIndex,
T: FromSql,
pub fn get_unwrap<I, T>(&self, idx: I) -> T where
I: RowIndex,
T: FromSql,
Get the value of a particular column of the result row.
Failure
Panics if calling row.get(idx)
would return an error,
including:
- If the underlying SQLite column type is not a valid type as a source
for
T
- If the underlying SQLite integral value is outside the range
representable by
T
- If
idx
is outside the range of columns in the returned query
pub fn get<I, T>(&self, idx: I) -> Result<T, Error> where
I: RowIndex,
T: FromSql,
pub fn get<I, T>(&self, idx: I) -> Result<T, Error> where
I: RowIndex,
T: FromSql,
Get the value of a particular column of the result row.
Failure
Returns an Error::InvalidColumnType
if the underlying SQLite column
type is not a valid type as a source for T
.
Returns an Error::InvalidColumnIndex
if idx
is outside the valid
column range for this row.
Returns an Error::InvalidColumnName
if idx
is not a valid column
name for this row.
If the result type is i128 (which requires the i128_blob
feature to be
enabled), and the underlying SQLite column is a blob whose size is not
16 bytes, Error::InvalidColumnType
will also be returned.
pub fn get_ref<I>(&self, idx: I) -> Result<ValueRef<'_>, Error> where
I: RowIndex,
pub fn get_ref<I>(&self, idx: I) -> Result<ValueRef<'_>, Error> where
I: RowIndex,
Get the value of a particular column of the result row as a ValueRef
,
allowing data to be read out of a row without copying.
This ValueRef
is valid only as long as this Row, which is enforced by
it’s lifetime. This means that while this method is completely safe,
it can be somewhat difficult to use, and most callers will be better
served by get
or get_unwrap
.
Failure
Returns an Error::InvalidColumnIndex
if idx
is outside the valid
column range for this row.
Returns an Error::InvalidColumnName
if idx
is not a valid column
name for this row.
pub fn get_ref_unwrap<I>(&self, idx: I) -> ValueRef<'_> where
I: RowIndex,
pub fn get_ref_unwrap<I>(&self, idx: I) -> ValueRef<'_> where
I: RowIndex,
Get the value of a particular column of the result row as a ValueRef
,
allowing data to be read out of a row without copying.
This ValueRef
is valid only as long as this Row, which is enforced by
it’s lifetime. This means that while this method is completely safe,
it can be difficult to use, and most callers will be better served by
get
or get_unwrap
.
Failure
Panics if calling row.get_ref(idx)
would return an
error, including:
- If
idx
is outside the range of columns in the returned query. - If
idx
is not a valid column name for this row.
pub fn get_raw_checked<I>(&self, idx: I) -> Result<ValueRef<'_>, Error> where
I: RowIndex,
👎 Deprecated: Use get_ref
instead.
pub fn get_raw_checked<I>(&self, idx: I) -> Result<ValueRef<'_>, Error> where
I: RowIndex,
Use get_ref
instead.
Renamed to get_ref
.
pub fn get_raw<I>(&self, idx: I) -> ValueRef<'_> where
I: RowIndex,
👎 Deprecated: Use get_ref_unwrap
instead.
pub fn get_raw<I>(&self, idx: I) -> ValueRef<'_> where
I: RowIndex,
Use get_ref_unwrap
instead.
Renamed to get_ref_unwrap
.
Trait Implementations
Auto Trait Implementations
impl<'stmt> !RefUnwindSafe for Row<'stmt>
impl<'stmt> !Send for Row<'stmt>
impl<'stmt> !Sync for Row<'stmt>
impl<'stmt> Unpin for Row<'stmt>
impl<'stmt> !UnwindSafe for Row<'stmt>
Blanket Implementations
impl<T> Any for T where
T: Any + ?Sized,
impl<T> Any for T where
T: Any + ?Sized,
fn type_id_compat(&self) -> TypeId
fn type_id_compat(&self) -> TypeId
TODO: once 1.33.0 is the minimum supported compiler version, remove Any::type_id_compat and use StdAny::type_id instead. https://github.com/rust-lang/rust/issues/27745 Read more
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> FutureExt for T
impl<T> FutureExt for T
fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more