Skip to main content

Response

Struct Response 

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

Response

Materialized query result: ordered (Id, Entity) pairs. IDs are returned for correlation, reporting, and lookup; they are public values and do not imply authorization, ownership, or row existence outside this response payload.

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 try_row(self) -> Result<Option<Row<E>>, ResponseError>

Source

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

Source

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

Source

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

Source

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

Source

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

Source

pub fn id(&self) -> Option<Id<E>>

Return the first row identifier, if present.

This identifier is a public value for correlation, reporting, and lookup only.

Source

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

Require exactly one row and return its identifier.

Source

pub fn ids(&self) -> Vec<Id<E>>

Return all row identifiers in response order for correlation/reporting/lookup.

Source

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

Check whether the response contains the provided identifier.

Source

pub fn view(&self) -> Result<<E as AsView>::ViewType, ResponseError>

Source

pub fn view_opt(&self) -> Result<Option<<E as AsView>::ViewType>, ResponseError>

Source

pub fn views(&self) -> Vec<<E as AsView>::ViewType>

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 = (Id<E>, 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>

§

impl<E> Send for Response<E>
where E: Send, <E as EntityKey>::Key: Send,

§

impl<E> Sync for Response<E>
where E: Sync, <E as EntityKey>::Key: Sync,

§

impl<E> Unpin for Response<E>
where E: Unpin, <E as EntityKey>::Key: Unpin,

§

impl<E> UnsafeUnpin for Response<E>

§

impl<E> UnwindSafe for Response<E>
where E: UnwindSafe, <E as EntityKey>::Key: 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