Skip to main content

NodeAndContext

Struct NodeAndContext 

Source
pub struct NodeAndContext<SE, PA>
where SE: StorageEngine + Send + Sync + 'static, PA: PolicyAgent + Send + Sync + 'static,
{ pub node: Node<SE, PA>, pub cdata: PA::ContextData, }

Fields§

§node: Node<SE, PA>§cdata: PA::ContextData

Implementations§

Source§

impl<SE, PA> NodeAndContext<SE, PA>
where SE: StorageEngine + Send + Sync + 'static, PA: PolicyAgent + Send + Sync + 'static,

Source

pub async fn fetch_entities( &self, collection_id: &CollectionId, args: MatchArgs, ) -> Result<Vec<Entity>, RetrievalError>

Fetch a list of entities based on a selection

Source

pub async fn commit_local_trx( &self, trx: &Transaction, ) -> Result<(), MutationError>

Does all the things necessary to commit a local transaction notably, the application of events to Entities works differently versus remote transactions

Trait Implementations§

Source§

impl<SE: StorageEngine + Send + Sync + 'static, PA: PolicyAgent + Send + Sync + 'static> TContext for NodeAndContext<SE, PA>

Source§

fn node_id(&self) -> EntityId

Source§

fn create_entity( &self, collection: CollectionId, trx_alive: Arc<AtomicBool>, ) -> Entity

Create a brand new entity for a transaction, and add it to the WeakEntitySet Note that this does not actually persist the entity to the storage engine It merely ensures that there are no duplicate entities with the same ID (except forked entities)
Source§

fn check_write(&self, entity: &Entity) -> Result<(), AccessDenied>

Source§

fn get_entity<'life0, 'life1, 'async_trait>( &'life0 self, id: EntityId, collection: &'life1 CollectionId, cached: bool, ) -> Pin<Box<dyn Future<Output = Result<Entity, RetrievalError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn get_resident_entity(&self, id: EntityId) -> Option<Entity>

Source§

fn fetch_entities<'life0, 'life1, 'async_trait>( &'life0 self, collection: &'life1 CollectionId, args: MatchArgs, ) -> Pin<Box<dyn Future<Output = Result<Vec<Entity>, RetrievalError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn commit_local_trx<'life0, 'life1, 'async_trait>( &'life0 self, trx: &'life1 Transaction, ) -> Pin<Box<dyn Future<Output = Result<(), MutationError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn query( &self, collection_id: CollectionId, args: MatchArgs, ) -> Result<EntityLiveQuery, RetrievalError>

Source§

fn collection<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 CollectionId, ) -> Pin<Box<dyn Future<Output = Result<StorageCollectionWrapper, RetrievalError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Auto Trait Implementations§

§

impl<SE, PA> Freeze for NodeAndContext<SE, PA>
where <PA as PolicyAgent>::ContextData: Freeze,

§

impl<SE, PA> !RefUnwindSafe for NodeAndContext<SE, PA>

§

impl<SE, PA> Send for NodeAndContext<SE, PA>

§

impl<SE, PA> Sync for NodeAndContext<SE, PA>

§

impl<SE, PA> Unpin for NodeAndContext<SE, PA>
where <PA as PolicyAgent>::ContextData: Unpin,

§

impl<SE, PA> UnsafeUnpin for NodeAndContext<SE, PA>

§

impl<SE, PA> !UnwindSafe for NodeAndContext<SE, PA>

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Iterable<T> for T

Source§

type Iter<'a> = Once<&'a T> where T: 'a

Source§

fn iterable(&self) -> <T as Iterable<T>>::Iter<'_>

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> StorageAccess<T> for T

Source§

fn as_borrowed(&self) -> &T

Borrows the value.
Source§

fn into_taken(self) -> T

Takes the value.
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

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ObserverBounds for T