Skip to main content

Response

Struct Response 

Source
pub struct Response<E: EntityKind>(pub Vec<Row<E>>);
Expand description

Response Materialized query result: ordered (Key, Entity) pairs.

Tuple Fields§

§0: Vec<Row<E>>

Implementations§

Source§

impl<E: EntityKind> Response<E>

Source

pub const fn count(&self) -> u32

Source

pub const fn is_empty(&self) -> bool

Source

pub const fn require_one(&self) -> Result<(), ResponseError>

Source

pub const fn require_some(&self) -> Result<(), ResponseError>

Source

pub fn row(self) -> Result<Row<E>, ResponseError>

Source

pub fn try_row(self) -> Result<Option<Row<E>>, ResponseError>

Source

pub fn rows(self) -> Vec<Row<E>>

Source

pub fn entity(self) -> Result<E, ResponseError>

Source

pub fn try_entity(self) -> Result<Option<E>, ResponseError>

Source

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

Source

pub fn key(&self) -> Option<Key>

Source

pub fn key_strict(self) -> Result<Key, ResponseError>

Source

pub fn try_key(self) -> Result<Option<Key>, ResponseError>

Source

pub fn keys(&self) -> Vec<Key>

Source

pub fn contains_key(&self, key: &Key) -> bool

Source

pub fn primary_key(self) -> Result<E::PrimaryKey, ResponseError>

Source

pub fn try_primary_key(self) -> Result<Option<E::PrimaryKey>, ResponseError>

Source

pub fn primary_keys(self) -> Vec<E::PrimaryKey>

Source

pub fn view(&self) -> Result<View<E>, ResponseError>

Source

pub fn view_opt(&self) -> Result<Option<View<E>>, ResponseError>

Source

pub fn views(&self) -> Vec<View<E>>

Trait Implementations§

Source§

impl<E: Debug + EntityKind> Debug for Response<E>

Source§

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

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

impl<E: EntityKind> IntoIterator for Response<E>

Source§

type Item = (Key, E)

The type of the elements being iterated over.
Source§

type IntoIter = IntoIter<<Response<E> 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<E> Freeze for Response<E>

§

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

§

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

§

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

§

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

§

impl<E> UnwindSafe for Response<E>
where E: 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> 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> 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