pub struct UnixConnector<ConnectorFactory = (), T = UnixTarget> { /* private fields */ }Available on
target_family="unix" only.Expand description
A connector which can be used to establish a Unix connection to a server.
Implementations§
Source§impl UnixConnector
impl UnixConnector
Sourcepub fn fixed(path: impl Into<PathBuf>) -> Self
pub fn fixed(path: impl Into<PathBuf>) -> Self
Create a new UnixConnector, which is used to establish a connection to a server
at a fixed path.
You can use middleware around the UnixConnector
or add connection pools, retry logic and more.
Source§impl<T> UnixConnector<(), T>
impl<T> UnixConnector<(), T>
Sourcepub fn with_connector<Connector>(
self,
connector: Connector,
) -> UnixConnector<UnixStreamConnectorCloneFactory<Connector>, T>
pub fn with_connector<Connector>( self, connector: Connector, ) -> UnixConnector<UnixStreamConnectorCloneFactory<Connector>, T>
Consume self to attach the given Connector (a UnixStreamConnector) as a new UnixConnector.
Sourcepub fn with_connector_factory<Factory>(
self,
factory: Factory,
) -> UnixConnector<Factory, T>
pub fn with_connector_factory<Factory>( self, factory: Factory, ) -> UnixConnector<Factory, T>
Consume self to attach the given Factory (a UnixStreamConnectorFactory) as a new UnixConnector.
Trait Implementations§
Source§impl<ConnectorFactory: Clone, UnixTarget: Clone> Clone for UnixConnector<ConnectorFactory, UnixTarget>
impl<ConnectorFactory: Clone, UnixTarget: Clone> Clone for UnixConnector<ConnectorFactory, UnixTarget>
Source§impl<ConnectorFactory: Debug, UnixTarget: Debug> Debug for UnixConnector<ConnectorFactory, UnixTarget>
impl<ConnectorFactory: Debug, UnixTarget: Debug> Debug for UnixConnector<ConnectorFactory, UnixTarget>
Source§impl<State, Request, ConnectorFactory> Service<State, Request> for UnixConnector<ConnectorFactory>
impl<State, Request, ConnectorFactory> Service<State, Request> for UnixConnector<ConnectorFactory>
Source§type Response = EstablishedClientConnection<UnixStream, State, Request>
type Response = EstablishedClientConnection<UnixStream, State, Request>
The type of response returned by the service.
Auto Trait Implementations§
impl<ConnectorFactory, T> Freeze for UnixConnector<ConnectorFactory, T>
impl<ConnectorFactory, T> RefUnwindSafe for UnixConnector<ConnectorFactory, T>where
ConnectorFactory: RefUnwindSafe,
T: RefUnwindSafe,
impl<ConnectorFactory, T> Send for UnixConnector<ConnectorFactory, T>
impl<ConnectorFactory, T> Sync for UnixConnector<ConnectorFactory, T>
impl<ConnectorFactory, T> Unpin for UnixConnector<ConnectorFactory, T>
impl<ConnectorFactory, T> UnwindSafe for UnixConnector<ConnectorFactory, T>where
ConnectorFactory: UnwindSafe,
T: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<S, State, Request, Connection> ConnectorService<State, Request> for S
impl<S, State, Request, Connection> ConnectorService<State, Request> for S
Source§type Connection = Connection
type Connection = Connection
Connection returned by the
ConnectorServiceSource§type Error = <S as Service<State, Request>>::Error
type Error = <S as Service<State, Request>>::Error
Error returned in case of connection / setup failure
Source§fn connect(
&self,
ctx: Context<State>,
req: Request,
) -> impl Future<Output = Result<EstablishedClientConnection<<S as ConnectorService<State, Request>>::Connection, State, Request>, <S as ConnectorService<State, Request>>::Error>> + Send
fn connect( &self, ctx: Context<State>, req: Request, ) -> impl Future<Output = Result<EstablishedClientConnection<<S as ConnectorService<State, Request>>::Connection, State, Request>, <S as ConnectorService<State, Request>>::Error>> + Send
Establish a connection, which often involves some kind of handshake,
or connection revival.