pub struct SessionLoadQuery<'a, C: CanisterKind, E: EntityKind<Canister = C>> { /* private fields */ }Expand description
SessionLoadQuery
Session-bound fluent wrapper for load queries.
Implementations§
Source§impl<C: CanisterKind, E: EntityKind<Canister = C>> SessionLoadQuery<'_, C, E>
impl<C: CanisterKind, E: EntityKind<Canister = C>> SessionLoadQuery<'_, C, E>
pub const fn query(&self) -> &Query<E>
Sourcepub fn by_id(self, id: Id<E>) -> Self
pub fn by_id(self, id: Id<E>) -> Self
Filter by a single typed primary-key value.
Id<E> is a public identifier and is treated as untrusted input until
verified by explicit existence/authorization checks in caller policy.
Sourcepub fn by_ids<I>(self, ids: I) -> Selfwhere
I: IntoIterator<Item = Id<E>>,
pub fn by_ids<I>(self, ids: I) -> Selfwhere
I: IntoIterator<Item = Id<E>>,
Load multiple entities by typed primary-key values.
IDs are correlation/lookup values only and do not grant authority.
pub fn filter(self, predicate: Predicate) -> Self
pub fn filter_expr(self, expr: FilterExpr) -> Result<Self, Error>
pub fn sort_expr(self, expr: SortExpr) -> Result<Self, Error>
pub fn order_by(self, field: impl AsRef<str>) -> Self
pub fn order_by_desc(self, field: impl AsRef<str>) -> Self
Sourcepub fn limit(self, limit: u32) -> Self
pub fn limit(self, limit: u32) -> Self
Bound the number of returned rows.
Pagination is only valid with explicit ordering; combine limit and/or
offset with order_by(...) or planning fails.
Sourcepub fn offset(self, offset: u32) -> Self
pub fn offset(self, offset: u32) -> Self
Skip a number of rows in the ordered result stream.
Pagination is only valid with explicit ordering; combine offset and/or
limit with order_by(...) or planning fails.
pub fn is_empty(&self) -> Result<bool, Error>where
E: EntityValue,
pub fn count(&self) -> Result<u32, Error>where
E: EntityValue,
pub fn execute(&self) -> Result<Response<E>, Error>where
E: EntityValue,
pub fn require_one(&self) -> Result<(), Error>where
E: EntityValue,
pub fn require_some(&self) -> Result<(), Error>where
E: EntityValue,
pub fn row(&self) -> Result<Row<E>, Error>where
E: EntityValue,
pub fn try_row(&self) -> Result<Option<Row<E>>, Error>where
E: EntityValue,
pub fn rows(&self) -> Result<Vec<Row<E>>, Error>where
E: EntityValue,
pub fn id(&self) -> Result<Option<Id<E>>, Error>where
E: EntityValue,
pub fn require_id(&self) -> Result<Id<E>, Error>where
E: EntityValue,
pub fn try_id(&self) -> Result<Option<Id<E>>, Error>where
E: EntityValue,
pub fn ids(&self) -> Result<Vec<Id<E>>, Error>where
E: EntityValue,
pub fn contains_id(&self, id: &Id<E>) -> Result<bool, Error>where
E: EntityValue,
pub fn entity(&self) -> Result<E, Error>where
E: EntityValue,
pub fn try_entity(&self) -> Result<Option<E>, Error>where
E: EntityValue,
pub fn entities(&self) -> Result<Vec<E>, Error>where
E: EntityValue,
pub fn view(&self) -> Result<<E as AsView>::ViewType, Error>where
E: EntityValue,
pub fn view_opt(&self) -> Result<Option<<E as AsView>::ViewType>, Error>where
E: EntityValue,
pub fn views(&self) -> Result<Vec<<E as AsView>::ViewType>, Error>where
E: EntityValue,
pub fn group_count_by<K>( self, key: impl Fn(&E) -> K, ) -> Result<HashMap<K, u32>, Error>
pub fn one(&self) -> Result<E, Error>where
E: EntityValue,
pub fn one_opt(&self) -> Result<Option<E>, Error>where
E: EntityValue,
pub fn all(&self) -> Result<Vec<E>, Error>where
E: EntityValue,
Source§impl<C: CanisterKind, E: EntityKind<Canister = C> + SingletonEntity> SessionLoadQuery<'_, C, E>
impl<C: CanisterKind, E: EntityKind<Canister = C> + SingletonEntity> SessionLoadQuery<'_, C, E>
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>
impl<'a, C, E> !UnwindSafe for SessionLoadQuery<'a, C, E>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more