pub struct CfgAddr(/* private fields */);
address
only.Expand description
A variation of general::SocketAddr
that allows shell expansions in Unix paths.
The string representation for these addresses is the same as for general::SocketAddr
;
but the shell expansion syntax is the same as for CfgPath
.
Shell expansion is only supported within paths: Even if the user has set ${HOME}
to 127.0.0.1
, the address inet:${HOME}:9999
is a syntax error.
In addition to the “inet:” and “unix:” schemas supported by general::SocketAddr
,
This type also supports a “unix-literal” schema,
to indicate that no shell expansion should occur.
Implementations§
Source§impl CfgAddr
impl CfgAddr
Sourcepub fn new_unix(path: CfgPath) -> Self
pub fn new_unix(path: CfgPath) -> Self
Create a new CfgAddr
that will produce an AF_UNIX
address
corresponding to the provided path.
Note that not all platforms support AF_UNIX addresses; on Windows, notably, expanding this path will produce an error.
Sourcepub fn address(
&self,
path_resolver: &CfgPathResolver,
) -> Result<SocketAddr, CfgAddrError>
pub fn address( &self, path_resolver: &CfgPathResolver, ) -> Result<SocketAddr, CfgAddrError>
Return the general::SocketAddr
produced by expanding this CfgAddr
.
Sourcepub fn substitutions_will_apply(&self) -> bool
pub fn substitutions_will_apply(&self) -> bool
Return true if this address is of a type to which variable substitutions will apply.
Currently, substitutions apply to AF_UNIX addresses but not to Inet addresses.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for CfgAddr
impl<'de> Deserialize<'de> for CfgAddr
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>,
Source§impl From<SocketAddr> for CfgAddr
impl From<SocketAddr> for CfgAddr
Source§fn from(value: SocketAddr) -> Self
fn from(value: SocketAddr) -> Self
Source§impl TryFrom<SocketAddr> for CfgAddr
impl TryFrom<SocketAddr> for CfgAddr
Source§type Error = UnixAddrNotAPath
type Error = UnixAddrNotAPath
impl Eq for CfgAddr
impl StructuralPartialEq for CfgAddr
Auto Trait Implementations§
impl Freeze for CfgAddr
impl RefUnwindSafe for CfgAddr
impl Send for CfgAddr
impl Sync for CfgAddr
impl Unpin for CfgAddr
impl UnwindSafe for CfgAddr
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
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> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 40 bytes