pub struct BootstrapTcpClient<W> { /* private fields */ }
Expand description
A Bootstrap that makes it easy to bootstrap a pipeline to use for TCP clients.
Implementations§
Source§impl<W: 'static> BootstrapTcpClient<W>
impl<W: 'static> BootstrapTcpClient<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 BootstrapTcpClient::connect.
Sourcepub async fn connect<A: AsyncToSocketAddrs>(
&mut self,
addr: A,
) -> Result<Rc<dyn OutboundPipeline<TaggedBytesMut, W>>, Error>
pub async fn connect<A: AsyncToSocketAddrs>( &mut self, addr: A, ) -> Result<Rc<dyn OutboundPipeline<TaggedBytesMut, W>>, Error>
Connects to the remote peer
Sourcepub async fn wait_for_stop(&self)
pub async fn wait_for_stop(&self)
Waits for stop of the client
Sourcepub async fn graceful_stop(&self)
pub async fn graceful_stop(&self)
Gracefully stop the client
Trait Implementations§
Auto Trait Implementations§
impl<W> Freeze for BootstrapTcpClient<W>
impl<W> !RefUnwindSafe for BootstrapTcpClient<W>
impl<W> !Send for BootstrapTcpClient<W>
impl<W> !Sync for BootstrapTcpClient<W>
impl<W> Unpin for BootstrapTcpClient<W>
impl<W> !UnwindSafe for BootstrapTcpClient<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