Skip to main content

Row

Struct Row 

Source
pub struct Row<L>(/* private fields */);
Expand description

A decoded row. Its fields are fixed by the query’s selection list, and each is read by the same value that selected it.

Implementations§

Source§

impl<L> Row<L>

Source

pub fn fields(&self) -> &L

The row’s fields as a RowCons chain, for walking it from another crate. get/take/into_struct cover reading a known field; this is for code that has to visit every field it happens to hold.

Source

pub fn get<K: LookupKey, Idx>( &self, _key: K, ) -> &<L as Field<K::Key, Idx>>::Value
where L: Field<K::Key, Idx>,

row.get(users::email) — the key is the same value that appeared in the selection list, so there is no name to keep in sync and no position to get wrong.

Source

pub fn take<K: LookupKey, Idx>( self, _key: K, ) -> (<L as Field<K::Key, Idx>>::Value, Row<<L as Field<K::Key, Idx>>::Rest>)
where L: Field<K::Key, Idx>,

Moves one field out and hands back the row without it, so several fields can be taken in turn.

Source

pub fn into_struct<T, Idxs>(self) -> T
where T: FromRow<L, Idxs>,

Builds a #[derive(FromRow)] struct out of this row, matching its fields by name. Extra columns in the row are ignored, and the order they were selected in doesn’t matter.

Source

pub fn into_tuple(self) -> L::Values
where L: RowValues,

The positional view: the plain tuple this selection would decode to if rows didn’t exist.

Trait Implementations§

Source§

impl<L: Clone> Clone for Row<L>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<L: DebugFields> Debug for Row<L>

Source§

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

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

impl<L: Eq> Eq for Row<L>

Source§

impl<L, Idx> HasCount<Idx> for Row<L>
where L: Field<Count, Idx>,

Source§

type Value = <L as Field<Count, Idx>>::Value

Source§

fn count(&self) -> &Self::Value

Source§

impl<L, Idx> HasDenseRank<Idx> for Row<L>
where L: Field<DenseRank, Idx>,

Source§

type Value = <L as Field<DenseRank, Idx>>::Value

Source§

fn dense_rank(&self) -> &Self::Value

Source§

impl<L, Idx> HasRank<Idx> for Row<L>
where L: Field<Rank, Idx>,

Source§

type Value = <L as Field<Rank, Idx>>::Value

Source§

fn rank(&self) -> &Self::Value

Source§

impl<L, Idx> HasRowNumber<Idx> for Row<L>
where L: Field<RowNumber, Idx>,

Source§

type Value = <L as Field<RowNumber, Idx>>::Value

Source§

fn row_number(&self) -> &Self::Value

Source§

impl<L: PartialEq> PartialEq for Row<L>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<A, B> SameShape<Row<B>> for Row<A>
where A: SameShape<B>,

Auto Trait Implementations§

§

impl<L> Freeze for Row<L>
where L: Freeze,

§

impl<L> RefUnwindSafe for Row<L>
where L: RefUnwindSafe,

§

impl<L> Send for Row<L>
where L: Send,

§

impl<L> Sync for Row<L>
where L: Sync,

§

impl<L> Unpin for Row<L>
where L: Unpin,

§

impl<L> UnsafeUnpin for Row<L>
where L: UnsafeUnpin,

§

impl<L> UnwindSafe for Row<L>
where L: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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<S> Superset<Nil, Nil> for S

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.
Source§

impl<T> WrapNullable<NotNull> for T