pub struct NodeInner<SE, PA> {
pub id: NodeId,
pub durable: bool,
pub reactor: Arc<Reactor<SE, PA>>,
/* private fields */
}Fields§
§id: NodeId§durable: bool§reactor: Arc<Reactor<SE, PA>>The reactor for handling subscriptions
Implementations§
Source§impl<SE, PA> NodeInner<SE, PA>
impl<SE, PA> NodeInner<SE, PA>
pub fn register_peer(&self, presence: Presence, sender: Box<dyn PeerSender>)
pub fn deregister_peer(&self, node_id: NodeId)
pub async fn request( &self, node_id: NodeId, request_body: NodeRequestBody, ) -> Result<NodeResponseBody, RequestError>
pub async fn handle_message( self: &Arc<Self>, message: NodeMessage, ) -> Result<()>
pub async fn request_remote_subscribe( &self, sub: &mut SubscriptionHandle, collection_id: &CollectionId, predicate: &Predicate, ) -> Result<()>
pub async fn request_remote_unsubscribe( &self, sub_id: SubscriptionId, peers: Vec<NodeId>, ) -> Result<()>
pub async fn collection(&self, id: &CollectionId) -> StorageCollectionWrapper
pub fn next_entity_id(&self) -> ID
pub fn context(self: &Arc<Self>, data: PA::ContextData) -> Context
Sourcepub async fn commit_events(self: &Arc<Self>, events: &Vec<Event>) -> Result<()>
pub async fn commit_events(self: &Arc<Self>, events: &Vec<Event>) -> Result<()>
Apply events to local state buffer and broadcast to peers.
Sourcepub async fn fetch_entities(
self: &Arc<Self>,
collection_id: &CollectionId,
args: MatchArgs,
_cdata: &PA::ContextData,
) -> Result<Vec<Arc<Entity>>, RetrievalError>
pub async fn fetch_entities( self: &Arc<Self>, collection_id: &CollectionId, args: MatchArgs, _cdata: &PA::ContextData, ) -> Result<Vec<Arc<Entity>>, RetrievalError>
Fetch a list of entities based on a predicate
pub async fn subscribe( self: &Arc<Self>, sub_id: SubscriptionId, collection_id: &CollectionId, args: MatchArgs, callback: Box<dyn Fn(ChangeSet<Arc<Entity>>) + Send + Sync + 'static>, ) -> Result<SubscriptionHandle, RetrievalError>
pub fn unsubscribe(self: &Arc<Self>, handle: &SubscriptionHandle) -> Result<()>
Sourcepub fn get_durable_peer_random(&self) -> Option<NodeId>
pub fn get_durable_peer_random(&self) -> Option<NodeId>
Get a random durable peer node ID
Sourcepub fn get_durable_peers(&self) -> Vec<NodeId>
pub fn get_durable_peers(&self) -> Vec<NodeId>
Get all durable peer node IDs
Auto Trait Implementations§
impl<SE, PA> !Freeze for NodeInner<SE, PA>
impl<SE, PA> !RefUnwindSafe for NodeInner<SE, PA>
impl<SE, PA> Send for NodeInner<SE, PA>
impl<SE, PA> Sync for NodeInner<SE, PA>
impl<SE, PA> Unpin for NodeInner<SE, PA>where
PA: Unpin,
impl<SE, PA> !UnwindSafe for NodeInner<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