pub struct ServerBuilder<H, T: Transport = DefaultTransport> { /* private fields */ }Expand description
Builder for configuring and creating a server.
The type parameter T selects the transport backend. When the
tcp-tokio feature is enabled (the default), T defaults to
ironsbe_transport::DefaultTransport so existing call-sites compile
without changes. With the feature disabled, T must be specified
explicitly so downstream crates can plug in a custom backend.
Implementations§
Source§impl<H: MessageHandler, T: Transport> ServerBuilder<H, T>
impl<H: MessageHandler, T: Transport> ServerBuilder<H, T>
Sourcepub fn bind(self, addr: SocketAddr) -> Self
pub fn bind(self, addr: SocketAddr) -> Self
Sets the bind address.
If a bind_config was previously supplied it
will be cleared, since the address is now ambiguous. Set the address
first, then customize via bind_config.
Sourcepub fn bind_config(self, config: T::BindConfig) -> Self
pub fn bind_config(self, config: T::BindConfig) -> Self
Supplies a backend-specific bind configuration.
Use this to override transport tunables (frame size, NODELAY, socket buffer sizes, …). When unset, the backend builds a default config from the bind address.
Sourcepub fn max_connections(self, max: usize) -> Self
pub fn max_connections(self, max: usize) -> Self
Sets the maximum number of connections.
Sourcepub fn channel_capacity(self, capacity: usize) -> Self
pub fn channel_capacity(self, capacity: usize) -> Self
Sets the channel capacity.
Sourcepub fn build(self) -> (Server<H, T>, ServerHandle)
pub fn build(self) -> (Server<H, T>, ServerHandle)
Source§impl<H: MessageHandler> ServerBuilder<H>
impl<H: MessageHandler> ServerBuilder<H>
Sourcepub fn with_default_transport() -> Self
pub fn with_default_transport() -> Self
Creates a new server builder using the default transport backend.
This is a convenience constructor that resolves the transport type
parameter to ironsbe_transport::DefaultTransport, keeping existing
call-sites like ServerBuilder::new().handler(h).build() working
without turbofish syntax.
Sourcepub fn max_frame_size(self, size: usize) -> Self
pub fn max_frame_size(self, size: usize) -> Self
Sets the maximum SBE frame size in bytes (Tokio TCP backend only).
Convenience shortcut that mutates the underlying
ironsbe_transport::tcp::TcpServerConfig without requiring callers
to construct it manually.