Skip to main content

SessionLoadQuery

Struct SessionLoadQuery 

Source
pub struct SessionLoadQuery<'a, C: CanisterKind, E: EntityKind<Canister = C>> { /* private fields */ }
Expand description

SessionLoadQuery

Fluent, session-bound load query wrapper that keeps intent pure while routing execution through the DbSession boundary.

Implementations§

Source§

impl<'a, C: CanisterKind, E: EntityKind<Canister = C>> SessionLoadQuery<'a, C, E>

Source

pub const fn query(&self) -> &Query<E>

Return a reference to the underlying intent.

Source

pub fn key(self, key: Key) -> Self

Source

pub fn filter(self, predicate: Predicate) -> Self

Add a predicate, implicitly AND-ing with any existing predicate.

Source

pub fn order_by(self, field: &'static str) -> Self

Append an ascending sort key.

Source

pub fn order_by_desc(self, field: &'static str) -> Self

Append a descending sort key.

Source

pub fn limit(self, limit: u32) -> Self

Apply a load limit to bound result size.

Source

pub fn offset(self, offset: u64) -> Self

Apply a load offset.

Source

pub fn explain(&self) -> Result<ExplainPlan, QueryError>

Explain this query without executing it.

Source

pub fn plan(&self) -> Result<ExecutablePlan<E>, QueryError>

Plan this query into an executor-ready plan.

Source

pub fn execute(&self) -> Result<Response<E>, QueryError>

Execute this query using the session’s policy settings.

Source

pub fn all(&self) -> Result<Vec<E>, QueryError>

Execute a load query and return all entities.

Source

pub fn one(&self) -> Result<E, QueryError>

Execute a load query and require exactly one entity.

Source

pub fn one_opt(&self) -> Result<Option<E>, QueryError>

Execute a load query and return zero or one entity.

Auto Trait Implementations§

§

impl<'a, C, E> Freeze for SessionLoadQuery<'a, C, E>

§

impl<'a, C, E> !RefUnwindSafe for SessionLoadQuery<'a, C, E>

§

impl<'a, C, E> !Send for SessionLoadQuery<'a, C, E>

§

impl<'a, C, E> !Sync for SessionLoadQuery<'a, C, E>

§

impl<'a, C, E> Unpin for SessionLoadQuery<'a, C, E>
where E: Unpin,

§

impl<'a, C, E> UnsafeUnpin for SessionLoadQuery<'a, C, E>

§

impl<'a, C, E> !UnwindSafe for SessionLoadQuery<'a, C, E>

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