Skip to main content

RowResponse

Struct RowResponse 

Source
pub struct RowResponse<R: ResponseRow>(/* private fields */);
Expand description

Response

Generic response transport container for one row shape R.

Implementations§

Source§

impl<R: ResponseRow> Response<R>

Source

pub const fn new(rows: Vec<R>) -> Self

Construct one response from ordered rows.

Source

pub const fn len(&self) -> usize

Return the number of rows.

Source

pub const fn count(&self) -> u32

Return the number of rows as a u32 API contract count.

Source

pub const fn is_empty(&self) -> bool

Return whether this response has no rows.

Source

pub fn rows(self) -> Vec<R>

Consume and return all rows in response order.

Source

pub const fn as_slice(&self) -> &[R]

Borrow rows as a slice in response order.

Source

pub fn iter(&self) -> Iter<'_, R>

Borrow an iterator over rows in response order.

Source§

impl<E: EntityKind> Response<Row<E>>

Source

pub fn entities(self) -> Vec<E>

Consume and return all entities in response order.

Source

pub fn ids(&self) -> impl Iterator<Item = Id<E>> + '_

Borrow an iterator over row identifiers in response order.

Source

pub fn contains_id(&self, id: &Id<E>) -> bool

Check whether the response contains the provided identifier.

Trait Implementations§

Source§

impl<R: Debug + ResponseRow> Debug for Response<R>

Source§

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

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

impl<'a, R: ResponseRow> IntoIterator for &'a Response<R>

Source§

type Item = &'a R

The type of the elements being iterated over.
Source§

type IntoIter = Iter<'a, R>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<R: ResponseRow> IntoIterator for Response<R>

Source§

type Item = R

The type of the elements being iterated over.
Source§

type IntoIter = IntoIter<<Response<R> as IntoIterator>::Item>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<R> Freeze for Response<R>

§

impl<R> RefUnwindSafe for Response<R>
where R: RefUnwindSafe,

§

impl<R> Send for Response<R>
where R: Send,

§

impl<R> Sync for Response<R>
where R: Sync,

§

impl<R> Unpin for Response<R>
where R: Unpin,

§

impl<R> UnsafeUnpin for Response<R>

§

impl<R> UnwindSafe for Response<R>
where R: 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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>,

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V