Struct strict_encoding::net::UniformAddr [−][src]
pub struct UniformAddr {
pub addr_format: AddrFormat,
pub addr: RawAddr,
pub port: Option<u16>,
pub transport: Option<Transport>,
}
Expand description
Structured uniform address representation, consisting of host address, (conforming a given address format) optional port and optional transport protocol
Fields
addr_format: AddrFormat
Address format (see AddrFormat
)
addr: RawAddr
Fixed-size byte string (of ADDR_LEN
length) containing uniformally-
encoded host address
port: Option<u16>
Optional port number
transport: Option<Transport>
Optional transport protocol (see Transport
)
Trait Implementations
Performs the conversion.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
type Strategy = UsingUniformAddr
type Strategy = UsingUniformAddr
Specific strategy. List of supported strategies: Read more
type Error = DecodeError
type Error = DecodeError
The type returned in the event of a conversion error.
Performs the conversion.
Should return which address format have to be used for address encoding
Should return transport protocol identifier, if applicable – or None
otherwise Read more
Transforms given address type into a structured uniform address
(see UniformAddr
) Read more
Constructs address of a given type from a structure uniform address data. Read more
Constructs address of a given type from a structured uniform address data. Read more
Produces unniformally-encoded byte representation of the address
(see RawUniformAddr
). Read more
fn from_raw_uniform_addr(uniform: RawUniformAddr) -> Result<Self, DecodeError> where
Self: Sized,
fn from_raw_uniform_addr(uniform: RawUniformAddr) -> Result<Self, DecodeError> where
Self: Sized,
Constructs address of a given type from a uniformly-encoded byte string
(see RawUniformAddr
). Read more
fn from_raw_uniform_addr_lossy(
uniform: RawUniformAddr
) -> Result<Self, DecodeError> where
Self: Sized,
fn from_raw_uniform_addr_lossy(
uniform: RawUniformAddr
) -> Result<Self, DecodeError> where
Self: Sized,
Constructs address of a given type from a uniformly-encoded byte string
(see RawUniformAddr
). Read more
Auto Trait Implementations
impl RefUnwindSafe for UniformAddr
impl Send for UniformAddr
impl Sync for UniformAddr
impl Unpin for UniformAddr
impl UnwindSafe for UniformAddr
Blanket Implementations
Mutably borrows from an owned value. Read more