Struct strict_encoding::net::UniformAddr
source · [−]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
sourceimpl Clone for UniformAddr
impl Clone for UniformAddr
sourcefn clone(&self) -> UniformAddr
fn clone(&self) -> UniformAddr
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for UniformAddr
impl Debug for UniformAddr
sourceimpl From<UniformAddr> for RawUniformAddr
impl From<UniformAddr> for RawUniformAddr
sourcefn from(addr: UniformAddr) -> Self
fn from(addr: UniformAddr) -> Self
Converts to this type from the input type.
sourceimpl Hash for UniformAddr
impl Hash for UniformAddr
sourceimpl Ord for UniformAddr
impl Ord for UniformAddr
sourceimpl PartialEq<UniformAddr> for UniformAddr
impl PartialEq<UniformAddr> for UniformAddr
sourcefn eq(&self, other: &UniformAddr) -> bool
fn eq(&self, other: &UniformAddr) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &UniformAddr) -> bool
fn ne(&self, other: &UniformAddr) -> bool
This method tests for !=
.
sourceimpl PartialOrd<UniformAddr> for UniformAddr
impl PartialOrd<UniformAddr> for UniformAddr
sourcefn partial_cmp(&self, other: &UniformAddr) -> Option<Ordering>
fn partial_cmp(&self, other: &UniformAddr) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl Strategy for UniformAddr
impl Strategy for UniformAddr
type Strategy = UsingUniformAddr
type Strategy = UsingUniformAddr
Specific strategy. List of supported strategies: Read more
sourceimpl TryFrom<[u8; 37]> for UniformAddr
impl TryFrom<[u8; 37]> for UniformAddr
type Error = DecodeError
type Error = DecodeError
The type returned in the event of a conversion error.
sourcefn try_from(raw: RawUniformAddr) -> Result<Self, DecodeError>
fn try_from(raw: RawUniformAddr) -> Result<Self, DecodeError>
Performs the conversion.
sourceimpl Uniform for UniformAddr
impl Uniform for UniformAddr
sourcefn addr_format(&self) -> AddrFormat
fn addr_format(&self) -> AddrFormat
Should return which address format have to be used for address encoding
sourcefn transport(&self) -> Option<Transport>
fn transport(&self) -> Option<Transport>
Should return transport protocol identifier, if applicable – or None
otherwise Read more
sourcefn to_uniform_addr(&self) -> UniformAddr
fn to_uniform_addr(&self) -> UniformAddr
Transforms given address type into a structured uniform address
(see UniformAddr
) Read more
sourcefn from_uniform_addr(addr: UniformAddr) -> Result<Self, DecodeError> where
Self: Sized,
fn from_uniform_addr(addr: UniformAddr) -> Result<Self, DecodeError> where
Self: Sized,
Constructs address of a given type from a structure uniform address data. Read more
sourcefn from_uniform_addr_lossy(addr: UniformAddr) -> Result<Self, DecodeError> where
Self: Sized,
fn from_uniform_addr_lossy(addr: UniformAddr) -> Result<Self, DecodeError> where
Self: Sized,
Constructs address of a given type from a structured uniform address data. Read more
sourcefn to_raw_uniform(&self) -> RawUniformAddr
fn to_raw_uniform(&self) -> RawUniformAddr
Produces unniformally-encoded byte representation of the address
(see RawUniformAddr
). Read more
sourcefn 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
sourcefn 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
impl Copy for UniformAddr
impl Eq for UniformAddr
impl StructuralEq for UniformAddr
impl StructuralPartialEq for UniformAddr
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more