pub struct Broker { /* private fields */ }Implementations§
Source§impl Broker
impl Broker
pub fn new() -> Self
pub fn create(opts: &Options) -> Self
pub fn stats(&self) -> BrokerStats
pub fn info<'a>() -> BrokerInfo<'a>
pub fn set_queue_size(&mut self, queue_size: usize)
pub async fn set_core_rpc_client(&self, client: RpcClient)
pub async fn register_client(&self, name: &str) -> Result<Client, Error>
Sourcepub async fn register_secondary_for(
&self,
client: &Client,
) -> Result<Client, Error>
pub async fn register_secondary_for( &self, client: &Client, ) -> Result<Client, Error>
§Panics
Will panic if the client’s secondaries mutex is poisoned
pub async fn unregister_client(&self, client: &Client)
Sourcepub fn force_disconnect(&self, name: &str) -> Result<(), Error>
pub fn force_disconnect(&self, name: &str) -> Result<(), Error>
Force disconnect a client
Errors
NotSupported - if attempted to disconnect an internal client NotRegistered - if a client is not registered (may be usually safely omitted)
pub async fn spawn_unix_server( &mut self, path: &str, config: ServerConfig, ) -> Result<(), Error>
pub async fn spawn_tcp_server( &mut self, path: &str, config: ServerConfig, ) -> Result<(), Error>
Sourcepub async fn spawn_websocket_server(
&mut self,
path: &str,
config: ServerConfig,
tls_config: Option<Arc<ServerConfig>>,
) -> Result<(), Error>
pub async fn spawn_websocket_server( &mut self, path: &str, config: ServerConfig, tls_config: Option<Arc<ServerConfig>>, ) -> Result<(), Error>
Spawn a websocket server at the given path (host:port)
pub fn spawn_server_connection( &mut self, stream: UnixStream, config: ServerConfig, ) -> Result<(), Error>
Trait Implementations§
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