Trait IServerBroker

Source
pub trait IServerBroker: Send + Sync {
Show 35 methods // Required methods fn remove_rendezvous<'life0, 'life1, 'async_trait>( &'life0 self, rendezvous: &'life1 SymKey, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn put_wallet_export<'life0, 'async_trait>( &'life0 self, rendezvous: SymKey, export: ExportedWallet, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_wallet_export<'life0, 'async_trait>( &'life0 self, rendezvous: SymKey, ) -> Pin<Box<dyn Future<Output = Result<ExportedWallet, ServerError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn put_wallet_at_rendezvous<'life0, 'async_trait>( &'life0 self, rendezvous: SymKey, export: ExportedWallet, ) -> Pin<Box<dyn Future<Output = Result<(), ServerError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn wait_for_wallet_at_rendezvous<'life0, 'async_trait>( &'life0 self, rendezvous: SymKey, ) -> Pin<Box<dyn Future<Output = Receiver<Result<ExportedWallet, ServerError>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_path_users(&self) -> PathBuf; fn get_block_storage(&self) -> Arc<RwLock<dyn BlockStorage + Send + Sync>>; fn put_block( &self, overlay_id: &OverlayId, block: Block, ) -> Result<(), ServerError>; fn has_block( &self, overlay_id: &OverlayId, block_id: &BlockId, ) -> Result<(), ServerError>; fn get_block( &self, overlay_id: &OverlayId, block_id: &BlockId, ) -> Result<Block, ServerError>; fn create_user<'life0, 'life1, 'async_trait>( &'life0 self, broker_id: &'life1 DirectPeerId, ) -> Pin<Box<dyn Future<Output = Result<UserId, ProtocolError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_user(&self, user_id: PubKey) -> Result<bool, ProtocolError>; fn has_no_user(&self) -> Result<bool, ProtocolError>; fn get_user_credentials( &self, user_id: &PubKey, ) -> Result<Credentials, ProtocolError>; fn add_user_credentials( &self, user_id: &PubKey, credentials: &Credentials, ) -> Result<(), ProtocolError>; fn add_user( &self, user_id: PubKey, is_admin: bool, ) -> Result<(), ProtocolError>; fn del_user(&self, user_id: PubKey) -> Result<(), ProtocolError>; fn list_users(&self, admins: bool) -> Result<Vec<PubKey>, ProtocolError>; fn list_invitations( &self, admin: bool, unique: bool, multi: bool, ) -> Result<Vec<(InvitationCode, u32, Option<String>)>, ProtocolError>; fn add_invitation( &self, invite_code: &InvitationCode, expiry: u32, memo: &Option<String>, ) -> Result<(), ProtocolError>; fn get_invitation_type(&self, invite: [u8; 32]) -> Result<u8, ProtocolError>; fn remove_invitation(&self, invite: [u8; 32]) -> Result<(), ProtocolError>; fn take_master_key(&mut self) -> Result<SymKey, ProtocolError>; fn app_process_request<'life0, 'life1, 'async_trait>( &'life0 self, req: AppRequest, request_id: i64, fsm: &'life1 Mutex<NoiseFSM>, ) -> Pin<Box<dyn Future<Output = Result<(), ServerError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn app_session_start<'life0, 'async_trait>( &'life0 self, req: AppSessionStart, remote_peer_id: DirectPeerId, local_peer_id: DirectPeerId, ) -> Pin<Box<dyn Future<Output = Result<AppSessionStartResponse, ServerError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn app_session_stop<'life0, 'life1, 'async_trait>( &'life0 self, req: AppSessionStop, remote_peer_id: &'life1 DirectPeerId, ) -> Pin<Box<dyn Future<Output = Result<EmptyAppResponse, ServerError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn next_seq_for_peer( &self, peer: &PeerId, seq: u64, ) -> Result<(), ServerError>; fn get_repo_pin_status( &self, overlay: &OverlayId, repo: &RepoHash, user_id: &UserId, ) -> Result<RepoPinStatus, ServerError>; fn pin_repo_write<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'life6, 'life7, 'async_trait>( &'life0 self, overlay: &'life1 OverlayAccess, repo: &'life2 RepoHash, user_id: &'life3 UserId, ro_topics: &'life4 Vec<TopicId>, rw_topics: &'life5 Vec<PublisherAdvert>, overlay_root_topic: &'life6 Option<TopicId>, expose_outer: bool, peer: &'life7 ClientPeerId, ) -> Pin<Box<dyn Future<Output = Result<RepoOpened, ServerError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait, 'life5: 'async_trait, 'life6: 'async_trait, 'life7: 'async_trait; fn pin_repo_read<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>( &'life0 self, overlay: &'life1 OverlayId, repo: &'life2 RepoHash, user_id: &'life3 UserId, ro_topics: &'life4 Vec<TopicId>, peer: &'life5 ClientPeerId, ) -> Pin<Box<dyn Future<Output = Result<RepoOpened, ServerError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait, 'life5: 'async_trait; fn topic_sub<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'life6, 'async_trait>( &'life0 self, overlay: &'life1 OverlayId, repo: &'life2 RepoHash, topic: &'life3 TopicId, user_id: &'life4 UserId, publisher: Option<&'life5 PublisherAdvert>, peer: &'life6 ClientPeerId, ) -> Pin<Box<dyn Future<Output = Result<TopicSubRes, ServerError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait, 'life5: 'async_trait, 'life6: 'async_trait; fn get_commit( &self, overlay: &OverlayId, id: &ObjectId, ) -> Result<Vec<Block>, ServerError>; fn dispatch_event<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, overlay: &'life1 OverlayId, event: Event, user_id: &'life2 UserId, remote_peer: &'life3 PubKey, ) -> Pin<Box<dyn Future<Output = Result<Vec<ClientPeerId>, ServerError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait; fn remove_all_subscriptions_of_client<'life0, 'life1, 'async_trait>( &'life0 self, client: &'life1 ClientPeerId, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn topic_sync_req( &self, overlay: &OverlayId, topic: &TopicId, known_heads: &Vec<ObjectId>, target_heads: &Vec<ObjectId>, known_commits: &Option<BloomFilter>, ) -> Result<Vec<TopicSyncRes>, ServerError>;
}

Required Methods§

Source

fn remove_rendezvous<'life0, 'life1, 'async_trait>( &'life0 self, rendezvous: &'life1 SymKey, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn put_wallet_export<'life0, 'async_trait>( &'life0 self, rendezvous: SymKey, export: ExportedWallet, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_wallet_export<'life0, 'async_trait>( &'life0 self, rendezvous: SymKey, ) -> Pin<Box<dyn Future<Output = Result<ExportedWallet, ServerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn put_wallet_at_rendezvous<'life0, 'async_trait>( &'life0 self, rendezvous: SymKey, export: ExportedWallet, ) -> Pin<Box<dyn Future<Output = Result<(), ServerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn wait_for_wallet_at_rendezvous<'life0, 'async_trait>( &'life0 self, rendezvous: SymKey, ) -> Pin<Box<dyn Future<Output = Receiver<Result<ExportedWallet, ServerError>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_path_users(&self) -> PathBuf

Source

fn get_block_storage(&self) -> Arc<RwLock<dyn BlockStorage + Send + Sync>>

Source

fn put_block( &self, overlay_id: &OverlayId, block: Block, ) -> Result<(), ServerError>

Source

fn has_block( &self, overlay_id: &OverlayId, block_id: &BlockId, ) -> Result<(), ServerError>

Source

fn get_block( &self, overlay_id: &OverlayId, block_id: &BlockId, ) -> Result<Block, ServerError>

Source

fn create_user<'life0, 'life1, 'async_trait>( &'life0 self, broker_id: &'life1 DirectPeerId, ) -> Pin<Box<dyn Future<Output = Result<UserId, ProtocolError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn get_user(&self, user_id: PubKey) -> Result<bool, ProtocolError>

Source

fn has_no_user(&self) -> Result<bool, ProtocolError>

Source

fn get_user_credentials( &self, user_id: &PubKey, ) -> Result<Credentials, ProtocolError>

Source

fn add_user_credentials( &self, user_id: &PubKey, credentials: &Credentials, ) -> Result<(), ProtocolError>

Source

fn add_user(&self, user_id: PubKey, is_admin: bool) -> Result<(), ProtocolError>

Source

fn del_user(&self, user_id: PubKey) -> Result<(), ProtocolError>

Source

fn list_users(&self, admins: bool) -> Result<Vec<PubKey>, ProtocolError>

Source

fn list_invitations( &self, admin: bool, unique: bool, multi: bool, ) -> Result<Vec<(InvitationCode, u32, Option<String>)>, ProtocolError>

Source

fn add_invitation( &self, invite_code: &InvitationCode, expiry: u32, memo: &Option<String>, ) -> Result<(), ProtocolError>

Source

fn get_invitation_type(&self, invite: [u8; 32]) -> Result<u8, ProtocolError>

Source

fn remove_invitation(&self, invite: [u8; 32]) -> Result<(), ProtocolError>

Source

fn take_master_key(&mut self) -> Result<SymKey, ProtocolError>

Source

fn app_process_request<'life0, 'life1, 'async_trait>( &'life0 self, req: AppRequest, request_id: i64, fsm: &'life1 Mutex<NoiseFSM>, ) -> Pin<Box<dyn Future<Output = Result<(), ServerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn app_session_start<'life0, 'async_trait>( &'life0 self, req: AppSessionStart, remote_peer_id: DirectPeerId, local_peer_id: DirectPeerId, ) -> Pin<Box<dyn Future<Output = Result<AppSessionStartResponse, ServerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn app_session_stop<'life0, 'life1, 'async_trait>( &'life0 self, req: AppSessionStop, remote_peer_id: &'life1 DirectPeerId, ) -> Pin<Box<dyn Future<Output = Result<EmptyAppResponse, ServerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn next_seq_for_peer(&self, peer: &PeerId, seq: u64) -> Result<(), ServerError>

Source

fn get_repo_pin_status( &self, overlay: &OverlayId, repo: &RepoHash, user_id: &UserId, ) -> Result<RepoPinStatus, ServerError>

Source

fn pin_repo_write<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'life6, 'life7, 'async_trait>( &'life0 self, overlay: &'life1 OverlayAccess, repo: &'life2 RepoHash, user_id: &'life3 UserId, ro_topics: &'life4 Vec<TopicId>, rw_topics: &'life5 Vec<PublisherAdvert>, overlay_root_topic: &'life6 Option<TopicId>, expose_outer: bool, peer: &'life7 ClientPeerId, ) -> Pin<Box<dyn Future<Output = Result<RepoOpened, ServerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait, 'life5: 'async_trait, 'life6: 'async_trait, 'life7: 'async_trait,

Source

fn pin_repo_read<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>( &'life0 self, overlay: &'life1 OverlayId, repo: &'life2 RepoHash, user_id: &'life3 UserId, ro_topics: &'life4 Vec<TopicId>, peer: &'life5 ClientPeerId, ) -> Pin<Box<dyn Future<Output = Result<RepoOpened, ServerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait, 'life5: 'async_trait,

Source

fn topic_sub<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'life6, 'async_trait>( &'life0 self, overlay: &'life1 OverlayId, repo: &'life2 RepoHash, topic: &'life3 TopicId, user_id: &'life4 UserId, publisher: Option<&'life5 PublisherAdvert>, peer: &'life6 ClientPeerId, ) -> Pin<Box<dyn Future<Output = Result<TopicSubRes, ServerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait, 'life5: 'async_trait, 'life6: 'async_trait,

Source

fn get_commit( &self, overlay: &OverlayId, id: &ObjectId, ) -> Result<Vec<Block>, ServerError>

Source

fn dispatch_event<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, overlay: &'life1 OverlayId, event: Event, user_id: &'life2 UserId, remote_peer: &'life3 PubKey, ) -> Pin<Box<dyn Future<Output = Result<Vec<ClientPeerId>, ServerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source

fn remove_all_subscriptions_of_client<'life0, 'life1, 'async_trait>( &'life0 self, client: &'life1 ClientPeerId, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn topic_sync_req( &self, overlay: &OverlayId, topic: &TopicId, known_heads: &Vec<ObjectId>, target_heads: &Vec<ObjectId>, known_commits: &Option<BloomFilter>, ) -> Result<Vec<TopicSyncRes>, ServerError>

Implementors§