pub struct Connect<T> { /* private fields */ }Expand description
Connect request
Implementations§
Source§impl<T: Address> Connect<T>
impl<T: Address> Connect<T>
Sourcepub fn new(req: T) -> Connect<T>
pub fn new(req: T) -> Connect<T>
Create Connect instance by splitting the string by ‘:’ and convert the second part to u16
Sourcepub fn with(req: T, addr: SocketAddr) -> Connect<T>
pub fn with(req: T, addr: SocketAddr) -> Connect<T>
Create new Connect instance from host and address. Connector skips name resolution stage
for such connect messages.
Sourcepub fn set_port(self, port: u16) -> Self
pub fn set_port(self, port: u16) -> Self
Use port if address does not provide one.
By default it set to 0
Sourcepub fn set_addr(self, addr: Option<SocketAddr>) -> Self
pub fn set_addr(self, addr: Option<SocketAddr>) -> Self
Use address.
Sourcepub fn set_addrs<I>(self, addrs: I) -> Selfwhere
I: IntoIterator<Item = SocketAddr>,
pub fn set_addrs<I>(self, addrs: I) -> Selfwhere
I: IntoIterator<Item = SocketAddr>,
Use addresses.
Sourcepub fn take_addrs(&mut self) -> ConnectTakeAddrsIter
pub fn take_addrs(&mut self) -> ConnectTakeAddrsIter
Takes pre-resolved addresses of the request.
Trait Implementations§
impl<T: Eq> Eq for Connect<T>
impl<T> StructuralPartialEq for Connect<T>
Auto Trait Implementations§
impl<T> Freeze for Connect<T>where
T: Freeze,
impl<T> RefUnwindSafe for Connect<T>where
T: RefUnwindSafe,
impl<T> Send for Connect<T>where
T: Send,
impl<T> Sync for Connect<T>where
T: Sync,
impl<T> Unpin for Connect<T>where
T: Unpin,
impl<T> UnwindSafe for Connect<T>where
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more