Struct retty::bootstrap::BootstrapTcpServer
source · pub struct BootstrapTcpServer<W> { /* private fields */ }Expand description
A Bootstrap that makes it easy to bootstrap a pipeline to use for TCP servers.
Implementations§
source§impl<W: 'static> BootstrapTcpServer<W>
impl<W: 'static> BootstrapTcpServer<W>
sourcepub fn max_payload_size(&mut self, max_payload_size: usize) -> &mut Self
pub fn max_payload_size(&mut self, max_payload_size: usize) -> &mut Self
Sets max payload size, default is 2048 bytes
sourcepub fn pipeline(
&mut self,
pipeline_factory_fn: PipelineFactoryFn<TaggedBytesMut, W>
) -> &mut Self
pub fn pipeline( &mut self, pipeline_factory_fn: PipelineFactoryFn<TaggedBytesMut, W> ) -> &mut Self
Creates pipeline instances from when calling BootstrapTcpServer::bind.
sourcepub async fn bind<A: AsyncToSocketAddrs>(
&self,
addr: A
) -> Result<SocketAddr, Error>
pub async fn bind<A: AsyncToSocketAddrs>( &self, addr: A ) -> Result<SocketAddr, Error>
Binds local address and port
sourcepub async fn wait_for_stop(&self)
pub async fn wait_for_stop(&self)
Waits for stop of the server
sourcepub async fn graceful_stop(&self)
pub async fn graceful_stop(&self)
Gracefully stop the server
Trait Implementations§
Auto Trait Implementations§
impl<W> !RefUnwindSafe for BootstrapTcpServer<W>
impl<W> !Send for BootstrapTcpServer<W>
impl<W> !Sync for BootstrapTcpServer<W>
impl<W> Unpin for BootstrapTcpServer<W>
impl<W> !UnwindSafe for BootstrapTcpServer<W>
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