pub struct FullAeAddr<T> { /* private fields */ }
Expand description
A specification for a full address to the target SCP: an application entity title, plus a generic address, typically a socket address.
These addresses can be serialized and parsed
with the syntax {ae_title}@{address}
,
where the socket address is parsed according to
the expectations of the parameter type T
.
For the version of the struct without a mandatory AE title,
see AeAddr
.
§Example
let addr: FullAeAddr<String> = "SCP-STORAGE@127.0.0.1:104".parse()?;
assert_eq!(addr.ae_title(), "SCP-STORAGE");
assert_eq!(addr.socket_addr(), "127.0.0.1:104");
let addr: FullAeAddr<SocketAddr> = "SCP-STORAGE@127.0.0.1:104".parse()?;
assert_eq!(addr.ae_title(), "SCP-STORAGE");
assert_eq!(addr.socket_addr(), &SocketAddr::from(([127, 0, 0, 1], 104)));
assert_eq!(&addr.to_string(), "SCP-STORAGE@127.0.0.1:104");
Implementations§
Source§impl<T> FullAeAddr<T>
impl<T> FullAeAddr<T>
Sourcepub fn new(ae_title: impl Into<String>, socket_addr: T) -> Self
pub fn new(ae_title: impl Into<String>, socket_addr: T) -> Self
Create an AE address from its bare constituent parts.
Sourcepub fn socket_addr(&self) -> &T
pub fn socket_addr(&self) -> &T
Retrieve the network address portion.
Sourcepub fn into_parts(self) -> (String, T)
pub fn into_parts(self) -> (String, T)
Convert the full address into its constituent parts.
Trait Implementations§
Source§impl<T: Clone> Clone for FullAeAddr<T>
impl<T: Clone> Clone for FullAeAddr<T>
Source§fn clone(&self) -> FullAeAddr<T>
fn clone(&self) -> FullAeAddr<T>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T: Debug> Debug for FullAeAddr<T>
impl<T: Debug> Debug for FullAeAddr<T>
Source§impl<T> Display for FullAeAddr<T>where
T: Display,
impl<T> Display for FullAeAddr<T>where
T: Display,
Source§impl<T> From<(String, T)> for FullAeAddr<T>
impl<T> From<(String, T)> for FullAeAddr<T>
Source§impl<T> From<FullAeAddr<T>> for AeAddr<T>
impl<T> From<FullAeAddr<T>> for AeAddr<T>
Source§fn from(full: FullAeAddr<T>) -> Self
fn from(full: FullAeAddr<T>) -> Self
Converts to this type from the input type.
Source§impl<T> FromStr for FullAeAddr<T>
impl<T> FromStr for FullAeAddr<T>
Source§impl<T: Hash> Hash for FullAeAddr<T>
impl<T: Hash> Hash for FullAeAddr<T>
Source§impl<T: PartialEq> PartialEq for FullAeAddr<T>
impl<T: PartialEq> PartialEq for FullAeAddr<T>
Source§impl<T> ToSocketAddrs for FullAeAddr<T>where
T: ToSocketAddrs,
impl<T> ToSocketAddrs for FullAeAddr<T>where
T: ToSocketAddrs,
Source§type Iter = <T as ToSocketAddrs>::Iter
type Iter = <T as ToSocketAddrs>::Iter
Returned iterator over socket addresses which this type may correspond
to.
Source§fn to_socket_addrs(&self) -> Result<Self::Iter>
fn to_socket_addrs(&self) -> Result<Self::Iter>
Converts this object to an iterator of resolved
SocketAddr
s. Read moreimpl<T: Eq> Eq for FullAeAddr<T>
impl<T> StructuralPartialEq for FullAeAddr<T>
Auto Trait Implementations§
impl<T> Freeze for FullAeAddr<T>where
T: Freeze,
impl<T> RefUnwindSafe for FullAeAddr<T>where
T: RefUnwindSafe,
impl<T> Send for FullAeAddr<T>where
T: Send,
impl<T> Sync for FullAeAddr<T>where
T: Sync,
impl<T> Unpin for FullAeAddr<T>where
T: Unpin,
impl<T> UnwindSafe for FullAeAddr<T>where
T: UnwindSafe,
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
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