[−][src]Struct systemd_socket::SocketAddr
Socket address that can be an ordinary address or a systemd socket
This is the core type of this crate that abstracts possible addresses.
It can be (fallibly) converted from various types of strings or deserialized with serde
.
After it's created, it can be bound as TcpListener
from std
or even tokio
or async_std
if the appropriate feature is enabled.
Optional dependencies on parse_arg
and serde
make it trivial to use with
configure_me
.
Implementations
impl SocketAddr
[src]
pub fn from_systemd_name<T: Into<String>>(name: T) -> Result<Self, ParseError>
[src]
Creates SocketAddr from systemd name directly, without requiring systemd://
prefix.
Always fails with systemd unsupported error if systemd is not supported.
pub fn bind(self) -> Result<TcpListener, BindError>
[src]
Creates std::net::TcpListener
This method either binds
the socket, if the address was provided or uses systemd socket
if the socket name was provided.
Trait Implementations
impl Debug for SocketAddr
[src]
impl Display for SocketAddr
[src]
Displays the address in format that can be parsed again.
Important: While I don't expect this impl to change, don't rely on it! It should be used mostly for debugging/logging.
impl<I: Into<IpAddr>> From<(I, u16)> for SocketAddr
[src]
impl From<SocketAddr> for SocketAddr
[src]
pub fn from(value: SocketAddr) -> Self
[src]
impl From<SocketAddrV4> for SocketAddr
[src]
pub fn from(value: SocketAddrV4) -> Self
[src]
impl From<SocketAddrV6> for SocketAddr
[src]
pub fn from(value: SocketAddrV6) -> Self
[src]
impl FromStr for SocketAddr
[src]
type Err = ParseError
The associated error which can be returned from parsing.
pub fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl<'a> TryFrom<&'a OsStr> for SocketAddr
[src]
type Error = ParseOsStrError
The type returned in the event of a conversion error.
pub fn try_from(s: &'a OsStr) -> Result<Self, Self::Error>
[src]
impl<'a> TryFrom<&'a str> for SocketAddr
[src]
type Error = ParseError
The type returned in the event of a conversion error.
pub fn try_from(s: &'a str) -> Result<Self, Self::Error>
[src]
impl TryFrom<OsString> for SocketAddr
[src]
type Error = ParseOsStrError
The type returned in the event of a conversion error.
pub fn try_from(s: OsString) -> Result<Self, Self::Error>
[src]
impl TryFrom<String> for SocketAddr
[src]
Auto Trait Implementations
impl RefUnwindSafe for SocketAddr
[src]
impl Send for SocketAddr
[src]
impl Sync for SocketAddr
[src]
impl Unpin for SocketAddr
[src]
impl UnwindSafe for SocketAddr
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,