pub(crate) struct AddrWithStr<A>{
string: String,
addr: A,
}Expand description
Represent an address type along with the string it was decoded from.
We use this type in connect points because, for some kinds of authentication, we need the literal input string that created the address.
Fields§
§string: StringThe string representation of the address.
For inet addresses, this is the value that appeared in the configuration. For unix domain sockets, this is the value that appeared in the configuration, after shell expansion.
addr: AThe address itself.
Implementations§
Source§impl<A> AddrWithStr<A>
impl<A> AddrWithStr<A>
Sourcepub(crate) fn as_str(&self) -> &str
pub(crate) fn as_str(&self) -> &str
Return the string representation of this address, for use in the authentication handshake.
Sourcepub(crate) fn set_string_from<B: Clone + Debug>(
&mut self,
other: &AddrWithStr<B>,
)
pub(crate) fn set_string_from<B: Clone + Debug>( &mut self, other: &AddrWithStr<B>, )
Replace the string representation of this address with the one in other.
Source§impl AddrWithStr<String>
impl AddrWithStr<String>
Sourcepub(crate) fn resolve(
&self,
resolver: &CfgPathResolver,
) -> Result<AddrWithStr<SocketAddr>, ResolveError>
pub(crate) fn resolve( &self, resolver: &CfgPathResolver, ) -> Result<AddrWithStr<SocketAddr>, ResolveError>
Convert an AddrWithStr<String> into its substituted form.
Trait Implementations§
Source§impl<A> AsRef<A> for AddrWithStr<A>
impl<A> AsRef<A> for AddrWithStr<A>
Source§impl<A> Clone for AddrWithStr<A>
impl<A> Clone for AddrWithStr<A>
Source§fn clone(&self) -> AddrWithStr<A>
fn clone(&self) -> AddrWithStr<A>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<A> Debug for AddrWithStr<A>
impl<A> Debug for AddrWithStr<A>
Source§impl<'de, A> Deserialize<'de> for AddrWithStr<A>
impl<'de, A> Deserialize<'de> for AddrWithStr<A>
Source§fn deserialize<__D>(deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<A> Display for AddrWithStr<A>
impl<A> Display for AddrWithStr<A>
Source§impl<A> FromStr for AddrWithStr<A>
impl<A> FromStr for AddrWithStr<A>
Auto Trait Implementations§
impl<A> Freeze for AddrWithStr<A>where
A: Freeze,
impl<A> RefUnwindSafe for AddrWithStr<A>where
A: RefUnwindSafe,
impl<A> Send for AddrWithStr<A>where
A: Send,
impl<A> Sync for AddrWithStr<A>where
A: Sync,
impl<A> Unpin for AddrWithStr<A>where
A: Unpin,
impl<A> UnsafeUnpin for AddrWithStr<A>where
A: UnsafeUnpin,
impl<A> UnwindSafe for AddrWithStr<A>where
A: UnwindSafe,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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