Struct protosocket_prost::ClientRegistry
source · pub struct ClientRegistry { /* private fields */ }Expand description
The root IO tracker for a class of clients. You can use different kinds of clients with a single registry. The registry generates network status events for connections - readable & writable. Connections themselves service the events and invoke read/writev.
Implementations§
source§impl ClientRegistry
impl ClientRegistry
sourcepub fn new() -> Result<(Self, ClientRegistryDriver)>
pub fn new() -> Result<(Self, ClientRegistryDriver)>
Construct a new client registry. You will spawn the registry driver, probably on a dedicated thread.
pub fn set_max_message_length(&mut self, max_message_length: usize)
pub fn set_max_queued_outbound_messages( &mut self, max_queued_outbound_messages: usize, )
sourcepub async fn register_client<Request, Response>(
&self,
address: impl Into<String>,
) -> Result<(Sender<Request>, Receiver<Response>, ConnectionDriver<ProstClientConnectionBindings<Request, Response>>)>
pub async fn register_client<Request, Response>( &self, address: impl Into<String>, ) -> Result<(Sender<Request>, Receiver<Response>, ConnectionDriver<ProstClientConnectionBindings<Request, Response>>)>
Get a new connection to a protosocket server.
Auto Trait Implementations§
impl Freeze for ClientRegistry
impl !RefUnwindSafe for ClientRegistry
impl Send for ClientRegistry
impl Sync for ClientRegistry
impl Unpin for ClientRegistry
impl !UnwindSafe for ClientRegistry
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