pub struct Node<SE, PA>(/* private fields */)
where
PA: PolicyAgent;Expand description
A participant in the Ankurah network, and primary place where queries are initiated
Implementations§
Source§impl<SE, PA> Node<SE, PA>
impl<SE, PA> Node<SE, PA>
pub fn new(engine: Arc<SE>, policy_agent: PA) -> Self
pub fn new_durable(engine: Arc<SE>, policy_agent: PA) -> Self
pub fn weak(&self) -> WeakNode<SE, PA>
pub fn register_peer(&self, presence: Presence, sender: Box<dyn PeerSender>)
pub fn deregister_peer(&self, node_id: EntityId)
pub async fn request<'a, C>(
&self,
node_id: EntityId,
cdata: &C,
request_body: NodeRequestBody,
) -> Result<NodeResponseBody, RequestError>where
C: Iterable<PA::ContextData>,
pub fn send_update(&self, node_id: EntityId, notification: NodeUpdateBody)
pub async fn handle_message(&self, message: NodeMessage) -> Result<()>
Sourcepub async fn commit_remote_transaction(
&self,
cdata: &PA::ContextData,
id: TransactionId,
events: Vec<Attested<Event>>,
) -> Result<(), MutationError>
pub async fn commit_remote_transaction( &self, cdata: &PA::ContextData, id: TransactionId, events: Vec<Attested<Event>>, ) -> Result<(), MutationError>
Does all the things necessary to commit a remote transaction
pub fn next_entity_id(&self) -> EntityId
pub fn context(&self, data: PA::ContextData) -> Result<Context, Error>
pub async fn context_async(&self, data: PA::ContextData) -> Context
Sourcepub fn get_durable_peer_random(&self) -> Option<EntityId>
pub fn get_durable_peer_random(&self) -> Option<EntityId>
Get a random durable peer node ID
Sourcepub fn get_durable_peers(&self) -> Vec<EntityId>
pub fn get_durable_peers(&self) -> Vec<EntityId>
Get all durable peer node IDs
Source§impl<SE, PA> Node<SE, PA>
impl<SE, PA> Node<SE, PA>
pub async fn fetch_entities_from_local( &self, collection_id: &CollectionId, selection: &Selection, ) -> Result<Vec<Entity>, RetrievalError>
Trait Implementations§
Source§impl<SE, PA> Clone for Node<SE, PA>where
PA: PolicyAgent,
impl<SE, PA> Clone for Node<SE, PA>where
PA: PolicyAgent,
Source§impl<SE, PA> Deref for Node<SE, PA>where
PA: PolicyAgent,
impl<SE, PA> Deref for Node<SE, PA>where
PA: PolicyAgent,
Source§impl<SE, PA> Display for Node<SE, PA>where
PA: PolicyAgent,
impl<SE, PA> Display for Node<SE, PA>where
PA: PolicyAgent,
Source§impl<SE: StorageEngine + Send + Sync + 'static, PA: PolicyAgent + Send + Sync + 'static> NodeComms for Node<SE, PA>
impl<SE: StorageEngine + Send + Sync + 'static, PA: PolicyAgent + Send + Sync + 'static> NodeComms for Node<SE, PA>
fn id(&self) -> EntityId
fn durable(&self) -> bool
fn system_root(&self) -> Option<Attested<EntityState>>
fn register_peer(&self, presence: Presence, sender: Box<dyn PeerSender>)
fn deregister_peer(&self, node_id: EntityId)
fn handle_message<'life0, 'async_trait>(
&'life0 self,
message: NodeMessage,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn cloned(&self) -> Box<dyn NodeComms>
Source§impl<SE, PA> TNodeErased for Node<SE, PA>
impl<SE, PA> TNodeErased for Node<SE, PA>
fn unsubscribe_remote_predicate(&self, query_id: QueryId)
fn update_remote_query( &self, query_id: QueryId, selection: Selection, version: u32, ) -> Result<(), Error>
fn fetch_entities_from_local<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
collection_id: &'life1 CollectionId,
selection: &'life2 Selection,
) -> Pin<Box<dyn Future<Output = Result<Vec<Entity>, RetrievalError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn reactor(&self) -> &Reactor<Entity>
fn has_subscription_relay(&self) -> bool
Auto Trait Implementations§
impl<SE, PA> Freeze for Node<SE, PA>
impl<SE, PA> !RefUnwindSafe for Node<SE, PA>
impl<SE, PA> Send for Node<SE, PA>
impl<SE, PA> Sync for Node<SE, PA>
impl<SE, PA> Unpin for Node<SE, PA>
impl<SE, PA> !UnwindSafe for Node<SE, PA>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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