pub struct Context(/* private fields */);Expand description
Type-erased context wrapper
Implementations§
Source§impl Context
impl Context
pub fn new<SE: StorageEngine + Send + Sync + 'static, PA: PolicyAgent + Send + Sync + 'static>( node: Node<SE, PA>, data: PA::ContextData, ) -> Self
pub fn node_id(&self) -> NodeId
Sourcepub fn begin(&self) -> Transaction
pub fn begin(&self) -> Transaction
Begin a transaction.
pub async fn get<R: View>(&self, id: ID) -> Result<R, RetrievalError>
pub async fn fetch<R: View>( &self, args: impl TryInto<MatchArgs, Error = impl Into<RetrievalError>>, ) -> Result<ResultSet<R>, RetrievalError>
Sourcepub async fn subscribe<F, R>(
&self,
args: impl TryInto<MatchArgs, Error = impl Into<RetrievalError>>,
callback: F,
) -> Result<SubscriptionHandle, RetrievalError>
pub async fn subscribe<F, R>( &self, args: impl TryInto<MatchArgs, Error = impl Into<RetrievalError>>, callback: F, ) -> Result<SubscriptionHandle, RetrievalError>
Subscribe to changes in entities matching a predicate
pub async fn collection(&self, id: &CollectionId) -> StorageCollectionWrapper
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Context
impl !RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl !UnwindSafe for Context
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