pub struct ProtosocketServerConfig { /* private fields */ }Expand description
A configurator for a protosocket server
Implementations§
Source§impl ProtosocketServerConfig
impl ProtosocketServerConfig
Sourcepub fn max_buffer_length(self, max_buffer_length: usize) -> Self
pub fn max_buffer_length(self, max_buffer_length: usize) -> Self
The maximum buffer length per connection on this server.
Sourcepub fn max_queued_outbound_messages(
self,
max_queued_outbound_messages: usize,
) -> Self
pub fn max_queued_outbound_messages( self, max_queued_outbound_messages: usize, ) -> Self
The maximum number of queued outbound messages per connection on this server.
Sourcepub fn buffer_allocation_increment(
self,
buffer_allocation_increment: usize,
) -> Self
pub fn buffer_allocation_increment( self, buffer_allocation_increment: usize, ) -> Self
The step size for allocating additional memory for connection buffers on this server.
Sourcepub fn socket_config(self, config: ProtosocketSocketConfig) -> Self
pub fn socket_config(self, config: ProtosocketSocketConfig) -> Self
The tcp socket configuration options for this server.
Sourcepub fn bind_tcp<Connector: ServerConnector<SocketListener = TcpSocketListener>>(
self,
address: SocketAddr,
connector: Connector,
) -> Result<ProtosocketServer<Connector>>
pub fn bind_tcp<Connector: ServerConnector<SocketListener = TcpSocketListener>>( self, address: SocketAddr, connector: Connector, ) -> Result<ProtosocketServer<Connector>>
Binds a tcp listener to the given address and returns a ProtosocketServer with this configuration. After binding, you must await the returned server future to process requests.
Sourcepub fn build_server<Connector: ServerConnector<SocketListener = Listener>, Listener: SocketListener>(
self,
listener: Listener,
connector: Connector,
) -> Result<ProtosocketServer<Connector>>
pub fn build_server<Connector: ServerConnector<SocketListener = Listener>, Listener: SocketListener>( self, listener: Listener, connector: Connector, ) -> Result<ProtosocketServer<Connector>>
Build a socket server with a configured listener and a socket Connector. After building, you must await the returned server future to process requests.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProtosocketServerConfig
impl RefUnwindSafe for ProtosocketServerConfig
impl Send for ProtosocketServerConfig
impl Sync for ProtosocketServerConfig
impl Unpin for ProtosocketServerConfig
impl UnwindSafe for ProtosocketServerConfig
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