Struct ruma::ServerName
source · [−]#[repr(transparent)]pub struct ServerName(_);
Expand description
A Matrix-spec compliant server name.
It consists of a host and an optional port (separated by a colon if present).
Implementations
sourceimpl ServerName
impl ServerName
sourceimpl ServerName
impl ServerName
sourcepub fn parse(s: impl AsRef<str>) -> Result<OwnedServerName, Error>
pub fn parse(s: impl AsRef<str>) -> Result<OwnedServerName, Error>
Try parsing a &str
into an OwnedServerName
.
The same can also be done using FromStr
, TryFrom
or TryInto
.
This function is simply more constrained and thus useful in generic contexts.
sourcepub fn parse_box(
s: impl AsRef<str> + Into<Box<str, Global>>
) -> Result<Box<ServerName, Global>, Error>
pub fn parse_box(
s: impl AsRef<str> + Into<Box<str, Global>>
) -> Result<Box<ServerName, Global>, Error>
Try parsing a &str
into a Box<ServerName>
.
The same can also be done using FromStr
, TryFrom
or TryInto
.
This function is simply more constrained and thus useful in generic contexts.
sourceimpl ServerName
impl ServerName
Trait Implementations
sourceimpl AsRef<ServerName> for OwnedServerName
impl AsRef<ServerName> for OwnedServerName
sourcefn as_ref(&self) -> &ServerName
fn as_ref(&self) -> &ServerName
Converts this type into a shared reference of the (usually inferred) input type.
sourceimpl AsRef<str> for ServerName
impl AsRef<str> for ServerName
sourceimpl Borrow<ServerName> for OwnedServerName
impl Borrow<ServerName> for OwnedServerName
sourcefn borrow(&self) -> &ServerName
fn borrow(&self) -> &ServerName
Immutably borrows from an owned value. Read more
sourceimpl Clone for Box<ServerName, Global>
impl Clone for Box<ServerName, Global>
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 ServerName
impl Debug for ServerName
sourceimpl<'de> Deserialize<'de> for Box<ServerName, Global>
impl<'de> Deserialize<'de> for Box<ServerName, Global>
sourcefn deserialize<D>(
deserializer: D
) -> Result<Box<ServerName, Global>, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D
) -> Result<Box<ServerName, Global>, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Display for ServerName
impl Display for ServerName
sourceimpl<'_> From<&ServerName> for Rc<ServerName>
impl<'_> From<&ServerName> for Rc<ServerName>
sourcefn from(s: &ServerName) -> Rc<ServerName>
fn from(s: &ServerName) -> Rc<ServerName>
Converts to this type from the input type.
sourceimpl<'_> From<&ServerName> for Arc<ServerName>
impl<'_> From<&ServerName> for Arc<ServerName>
sourcefn from(s: &ServerName) -> Arc<ServerName>
fn from(s: &ServerName) -> Arc<ServerName>
Converts to this type from the input type.
sourceimpl<'_> From<&ServerName> for Box<ServerName, Global>
impl<'_> From<&ServerName> for Box<ServerName, Global>
sourcefn from(id: &ServerName) -> Box<ServerName, Global>
fn from(id: &ServerName) -> Box<ServerName, Global>
Converts to this type from the input type.
sourceimpl<'_> From<&ServerName> for OwnedServerName
impl<'_> From<&ServerName> for OwnedServerName
sourcefn from(id: &ServerName) -> OwnedServerName
fn from(id: &ServerName) -> OwnedServerName
Converts to this type from the input type.
sourceimpl<'_> From<&ServerName> for String
impl<'_> From<&ServerName> for String
sourcefn from(id: &ServerName) -> String
fn from(id: &ServerName) -> String
Converts to this type from the input type.
sourceimpl Hash for ServerName
impl Hash for ServerName
sourceimpl Ord for ServerName
impl Ord for ServerName
sourceimpl<'_> PartialEq<&ServerName> for OwnedServerName
impl<'_> PartialEq<&ServerName> for OwnedServerName
sourceimpl<'_> PartialEq<&str> for ServerName
impl<'_> PartialEq<&str> for ServerName
sourceimpl<'_> PartialEq<Box<ServerName, Global>> for &ServerName
impl<'_> PartialEq<Box<ServerName, Global>> for &ServerName
sourceimpl PartialEq<Box<ServerName, Global>> for ServerName
impl PartialEq<Box<ServerName, Global>> for ServerName
sourceimpl PartialEq<OwnedServerName> for ServerName
impl PartialEq<OwnedServerName> for ServerName
sourceimpl<'_> PartialEq<OwnedServerName> for &ServerName
impl<'_> PartialEq<OwnedServerName> for &ServerName
sourceimpl PartialEq<ServerName> for OwnedServerName
impl PartialEq<ServerName> for OwnedServerName
sourceimpl PartialEq<ServerName> for str
impl PartialEq<ServerName> for str
sourceimpl PartialEq<ServerName> for ServerName
impl PartialEq<ServerName> for ServerName
sourcefn eq(&self, other: &ServerName) -> bool
fn eq(&self, other: &ServerName) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ServerName) -> bool
fn ne(&self, other: &ServerName) -> bool
This method tests for !=
.
sourceimpl<'_> PartialEq<ServerName> for &str
impl<'_> PartialEq<ServerName> for &str
sourceimpl PartialEq<String> for ServerName
impl PartialEq<String> for ServerName
sourceimpl PartialEq<str> for ServerName
impl PartialEq<str> for ServerName
sourceimpl PartialOrd<ServerName> for ServerName
impl PartialOrd<ServerName> for ServerName
sourcefn partial_cmp(&self, other: &ServerName) -> Option<Ordering>
fn partial_cmp(&self, other: &ServerName) -> 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 Serialize for ServerName
impl Serialize for ServerName
sourcefn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
sourceimpl ToOwned for ServerName
impl ToOwned for ServerName
type Owned = OwnedServerName
type Owned = OwnedServerName
The resulting type after obtaining ownership.
sourcefn to_owned(&self) -> <ServerName as ToOwned>::Owned
fn to_owned(&self) -> <ServerName as ToOwned>::Owned
Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · sourcefn clone_into(&self, target: &mut Self::Owned)
fn clone_into(&self, target: &mut Self::Owned)
Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<'a> TryFrom<&'a str> for &'a ServerName
impl<'a> TryFrom<&'a str> for &'a ServerName
impl Eq for ServerName
impl StructuralEq for ServerName
impl StructuralPartialEq for ServerName
Auto Trait Implementations
impl RefUnwindSafe for ServerName
impl Send for ServerName
impl !Sized for ServerName
impl Sync for ServerName
impl Unpin for ServerName
impl UnwindSafe for ServerName
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> CallHasher for T where
T: Hash + ?Sized,
impl<T> CallHasher for T where
T: Hash + ?Sized,
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.