pub struct BridgeService {
pub connected_peers: Arc<RwLock<HashMap<String, ConnectedPeer>>>,
/* private fields */
}Fields§
§connected_peers: Arc<RwLock<HashMap<String, ConnectedPeer>>>Implementations§
Source§impl BridgeService
impl BridgeService
pub const fn node(&self) -> &Arc<IrohNode> ⓘ
pub fn shutdown_receiver(&self) -> Receiver<()>
pub fn is_blocked(&self, node_id: &str) -> bool
Sourcepub async fn get_or_create_collection(
&self,
collection_id: &str,
) -> Result<NamespaceId>
pub async fn get_or_create_collection( &self, collection_id: &str, ) -> Result<NamespaceId>
Get or create a doc namespace for a collection_id.
§Errors
Returns an error if the namespace cannot be created or opened.
Sourcepub async fn get_collection(&self, collection_id: &str) -> Result<NamespaceId>
pub async fn get_collection(&self, collection_id: &str) -> Result<NamespaceId>
Sourcepub async fn insert_collection(
&self,
collection_id: &str,
namespace: NamespaceId,
)
pub async fn insert_collection( &self, collection_id: &str, namespace: NamespaceId, )
Insert a doc namespace for a collection_id (used by import_collection).
Sourcepub async fn subscribe_gossip(
&self,
topic_str: &str,
with_discovery: bool,
) -> Result<GossipSender>
pub async fn subscribe_gossip( &self, topic_str: &str, with_discovery: bool, ) -> Result<GossipSender>
Sourcepub async fn leave_gossip(&self, topic_str: &str)
pub async fn leave_gossip(&self, topic_str: &str)
Leave a gossip topic.
Sourcepub async fn send_gossip(&self, topic_str: &str, message: &[u8]) -> Result<()>
pub async fn send_gossip(&self, topic_str: &str, message: &[u8]) -> Result<()>
Send a gossip message to a topic.
§Errors
Returns an error if the topic is not subscribed or publishing fails.
Sourcepub fn block_peer(&self, node_id: &str) -> Result<()>
pub fn block_peer(&self, node_id: &str) -> Result<()>
Sourcepub fn unblock_peer(&self, node_id: &str) -> Result<()>
pub fn unblock_peer(&self, node_id: &str) -> Result<()>
Sourcepub fn get_blocked_peers(&self) -> Vec<String>
pub fn get_blocked_peers(&self) -> Vec<String>
Get blocked peers.
Trait Implementations§
Source§impl Clone for BridgeService
impl Clone for BridgeService
Source§fn clone(&self) -> BridgeService
fn clone(&self) -> BridgeService
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for BridgeService
impl !UnwindSafe for BridgeService
impl Freeze for BridgeService
impl Send for BridgeService
impl Sync for BridgeService
impl Unpin for BridgeService
impl UnsafeUnpin for BridgeService
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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