pub struct ConnectOptions<'n> { /* private fields */ }Expand description
Client-side builder for local socket streams, including Stream.
Implementations§
Source§impl ConnectOptions<'_>
Creation and ownership.
impl ConnectOptions<'_>
Creation and ownership.
Source§impl<'n> ConnectOptions<'n>
Option setters.
impl<'n> ConnectOptions<'n>
Option setters.
Sourcepub fn wait_mode(self, wait_mode: ConnectWaitMode) -> Self
pub fn wait_mode(self, wait_mode: ConnectWaitMode) -> Self
Sets the wait mode of the connection operation.
This defaults to unbounded waiting.
§Platform-specific behavior
§Unix
Number of additional fcntls if SOCK_NONBLOCK is available:
| wait_mode \ nonblocking_stream | false | true |
|---|---|---|
| Unbounded | 0 | 1 |
| Timeout | 1 | 0 |
| Deferred | 1 | 0 |
Number of additional fcntls if SOCK_NONBLOCK is not available:
| wait_mode \ nonblocking_stream | false | true |
|---|---|---|
| Unbounded | 0 | 1 |
| Timeout | 2 | 1 |
| Deferred | 2 | 1 |
§Windows
WaitMode::Timeout has no effect in that attempting to connect to an overloaded named
pipe will always return an error as soon as possible. If the named pipe is across the
network, this may entail blocking on network activity for a duration that exceeds the
specified timeout.
WaitMode::Deferred is not supported, and an error will be returned by connect_* if it
is used.
Sourcepub fn nonblocking_stream(self, nonblocking: bool) -> Self
pub fn nonblocking_stream(self, nonblocking: bool) -> Self
Source§impl ConnectOptions<'_>
Stream constructors.
impl ConnectOptions<'_>
Stream constructors.
Sourcepub fn connect_sync(&self) -> Result<Stream>
pub fn connect_sync(&self) -> Result<Stream>
Creates a Stream by connecting to the specified local socket name.
On platforms where there are multiple available implementations, this dispatches to the appropriate implementation based on where the name points to.
Sourcepub fn connect_sync_as<S: Stream>(&self) -> Result<S>
pub fn connect_sync_as<S: Stream>(&self) -> Result<S>
Creates the given type of stream by connecting to the specified local socket name.
Sourcepub fn connect_tokio(
&self,
) -> impl Future<Output = Result<TokioStream>> + Send + Sync + '_
Available on crate feature tokio only.
pub fn connect_tokio( &self, ) -> impl Future<Output = Result<TokioStream>> + Send + Sync + '_
tokio only.Creates a Tokio Stream by connecting to the specified local socket name.
On platforms where there are multiple available implementations, this dispatches to the appropriate implementation based on where the name points to.
Sourcepub fn connect_tokio_as<S: Stream>(
&self,
) -> impl Future<Output = Result<S>> + Send + Sync + '_
Available on crate feature tokio only.
pub fn connect_tokio_as<S: Stream>( &self, ) -> impl Future<Output = Result<S>> + Send + Sync + '_
tokio only.Creates the given type of Tokio stream by connecting to the specified local socket name.