pub struct WshMultiProxy {
proxies: Arc<Mutex<HashMap<String, Sender<Vec<u8>>>>>,
}Expand description
Multi-connection broadcast proxy. Sends messages to multiple remote connections simultaneously.
Fields§
§proxies: Arc<Mutex<HashMap<String, Sender<Vec<u8>>>>>Implementations§
Source§impl WshMultiProxy
impl WshMultiProxy
pub fn new() -> Self
Sourcepub fn remove_proxy(&self, name: &str)
pub fn remove_proxy(&self, name: &str)
Remove a named proxy connection.
Sourcepub async fn broadcast_rpc_message(
&self,
msg: &RpcMessage,
) -> Result<(), String>
pub async fn broadcast_rpc_message( &self, msg: &RpcMessage, ) -> Result<(), String>
Broadcast an RPC message to all connected proxies.
Sourcepub fn proxy_count(&self) -> usize
pub fn proxy_count(&self) -> usize
Get the count of connected proxies.
Sourcepub fn proxy_names(&self) -> Vec<String>
pub fn proxy_names(&self) -> Vec<String>
Get names of all connected proxies.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WshMultiProxy
impl RefUnwindSafe for WshMultiProxy
impl Send for WshMultiProxy
impl Sync for WshMultiProxy
impl Unpin for WshMultiProxy
impl UnwindSafe for WshMultiProxy
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.