pub struct ViewContext {
pub db: LocalReadOnly,
pub from: QueryBuilder,
/* private fields */
}Expand description
One of two possible types that can be passed as the first argument to a #[view].
The other is AnonymousViewContext.
Use this type if the view depends on the caller’s identity.
Fields§
§db: LocalReadOnly§from: QueryBuilderImplementations§
Source§impl ViewContext
impl ViewContext
pub fn new(sender: Identity) -> Self
Sourcepub fn as_anonymous(&self) -> AnonymousViewContext
pub fn as_anonymous(&self) -> AnonymousViewContext
Obtain an AnonymousViewContext by dropping sender.
Trait Implementations§
Source§impl CtxDbRead for ViewContext
impl CtxDbRead for ViewContext
fn db_read_only(&self) -> &LocalReadOnly
Source§impl CtxWithSender for ViewContext
impl CtxWithSender for ViewContext
Source§impl DbContext for ViewContext
impl DbContext for ViewContext
Source§type DbView = LocalReadOnly
type DbView = LocalReadOnly
👎Deprecated:
Use the capability based traits (CtxDbRead, CtxDbWrite) instead!
A view into the tables of a database. Read more
Source§fn db(&self) -> &Self::DbView
fn db(&self) -> &Self::DbView
👎Deprecated:
Use the capability based traits (CtxDbRead, CtxDbWrite) instead!
Get a view into the tables. Read more
Source§fn db_read_only(&self) -> &LocalReadOnly
fn db_read_only(&self) -> &LocalReadOnly
👎Deprecated:
Use the capability based traits (CtxDbRead, CtxDbWrite) instead!
Get a read-only view into the tables. Read more
Auto Trait Implementations§
impl Freeze for ViewContext
impl RefUnwindSafe for ViewContext
impl Send for ViewContext
impl Sync for ViewContext
impl Unpin for ViewContext
impl UnsafeUnpin for ViewContext
impl UnwindSafe for ViewContext
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more