Struct diesel::row::PartialRow

source ·
pub struct PartialRow<'a, R> { /* private fields */ }
Expand description

A row type that wraps an inner row

This type only allows to access fields of the inner row, whose index is part of range. This type is used by diesel internally to implement FromStaticSqlRow.

Indexing via usize starts with 0 for this row type. The index is then shifted by self.range.start to match the corresponding field in the underlying row.

Implementations§

source§

impl<'a, R> PartialRow<'a, R>

source

pub fn new<'b, DB>(inner: &'a R, range: Range<usize>) -> Self
where R: Row<'b, DB>, DB: Backend,

Create a new PartialRow instance based on an inner row and a range of field that should be part of the constructed wrapper.

See the documentation of PartialRow for details.

Trait Implementations§

source§

impl<'a, R: Debug> Debug for PartialRow<'a, R>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a, 'b, DB, R> Row<'a, DB> for PartialRow<'b, R>
where DB: Backend, R: Row<'a, DB>,

§

type InnerPartialRow = R

Return type of PartialRow Read more
source§

fn field_count(&self) -> usize

Get the number of fields in the current row
source§

fn get<'c, I>( &'c self, idx: I, ) -> Option<<Self as RowGatWorkaround<'c, DB>>::Field>
where Self: RowIndex<I>, 'a: 'c,

Get the field with the provided index from the row. Read more
source§

fn partial_row(&self, range: Range<usize>) -> PartialRow<'_, R>

Returns a wrapping row that allows only to access fields, where the index is part of the provided range.
source§

fn get_value<ST, T, I>(&self, idx: I) -> Result<T>
where Self: RowIndex<I>, T: FromSql<ST, DB>,

Get a deserialized value with the provided index from the row.
source§

impl<'a, 'b, DB, R> RowGatWorkaround<'a, DB> for PartialRow<'b, R>
where DB: Backend, R: RowGatWorkaround<'a, DB>,

§

type Field = <R as RowGatWorkaround<'a, DB>>::Field

Field type returned by a Row implementation Read more
source§

impl<'a, 'b, R> RowIndex<&'a str> for PartialRow<'b, R>
where R: RowIndex<&'a str>,

source§

fn idx(&self, idx: &'a str) -> Option<usize>

Get the numeric index inside the current row for the provided index value
source§

impl<'a, R> RowIndex<usize> for PartialRow<'a, R>
where R: RowIndex<usize>,

source§

fn idx(&self, idx: usize) -> Option<usize>

Get the numeric index inside the current row for the provided index value

Auto Trait Implementations§

§

impl<'a, R> Freeze for PartialRow<'a, R>

§

impl<'a, R> RefUnwindSafe for PartialRow<'a, R>
where R: RefUnwindSafe,

§

impl<'a, R> Send for PartialRow<'a, R>
where R: Sync,

§

impl<'a, R> Sync for PartialRow<'a, R>
where R: Sync,

§

impl<'a, R> Unpin for PartialRow<'a, R>

§

impl<'a, R> UnwindSafe for PartialRow<'a, R>
where R: RefUnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoSql for T

source§

fn into_sql<T>(self) -> AsExprOf<Self, T>

Convert self to an expression for Diesel’s query builder. Read more
source§

fn as_sql<'a, T>(&'a self) -> AsExprOf<&'a Self, T>

Convert &self to an expression for Diesel’s query builder. Read more
source§

impl<'a, R, DB> NamedRow<'a, DB> for R
where R: Row<'a, DB>, DB: Backend,

source§

fn get<ST, T>( &self, column_name: &str, ) -> Result<T, Box<dyn Error + Send + Sync>>
where T: FromSql<ST, DB>,

Retrieve and deserialize a single value from the query Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.