pub struct Broker { /* private fields */ }
Implementations§
Source§impl Broker
impl Broker
pub fn get_server_peer_id(&self) -> DirectPeerId
pub fn set_server_config(&mut self, config: ServerConfig)
pub fn set_listeners( &mut self, listeners: HashMap<String, ListenerInfo>, ) -> (HashMap<String, ListenerInfo>, HashMap<BindAddress, String>)
pub async fn join_shutdown() -> Result<(), ProtocolError>
Sourcepub async fn join_shutdown_with_timeout(
timeout: Duration,
) -> Result<(), ProtocolError>
pub async fn join_shutdown_with_timeout( timeout: Duration, ) -> Result<(), ProtocolError>
Used in tests mostly
pub async fn graceful_shutdown()
pub async fn close_all_connections()
pub async fn probe( &mut self, cnx: Box<dyn IConnect>, ip: IP, port: u16, ) -> Result<Option<PubKey>, ProtocolError>
pub async fn admin<A: Into<ProtocolMessage> + Into<AdminRequestContentV0> + Debug + Sync + Send + 'static>( &mut self, cnx: Box<dyn IConnect>, peer_privk: PrivKey, peer_pubk: PubKey, remote_peer_id: DirectPeerId, user: PubKey, user_priv: PrivKey, addr: BindAddress, request: A, ) -> Result<AdminResponseContentV0, ProtocolError>
pub async fn ext<A: Into<ProtocolMessage> + Into<ExtRequestContentV0> + Debug + Sync + Send + 'static, B: TryFrom<ProtocolMessage, Error = ProtocolError> + Debug + Sync + Send + 'static>( cnx: Box<dyn IConnect>, peer_privk: PrivKey, peer_pubk: PubKey, remote_peer_id: DirectPeerId, url: String, request: A, ) -> Result<B, NgError>
pub async fn connect( &mut self, cnx: Arc<Box<dyn IConnect>>, peer_privk: PrivKey, peer_pubk: PubKey, remote_peer_id: DirectPeerId, config: StartConfig, ) -> Result<(), ProtocolError>
pub async fn request<A: Into<ProtocolMessage> + Debug + Sync + Send + 'static, B: TryFrom<ProtocolMessage, Error = ProtocolError> + Debug + Sync + Send + 'static>( &self, user: &Option<UserId>, remote_peer_id: &Option<DirectPeerId>, msg: A, ) -> Result<SoS<B>, NgError>
pub async fn close_peer_connection( &mut self, peer_id: &DirectPeerId, user: Option<PubKey>, )
Auto Trait Implementations§
impl Freeze for Broker
impl !RefUnwindSafe for Broker
impl Send for Broker
impl Sync for Broker
impl Unpin for Broker
impl !UnwindSafe for Broker
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> 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