Struct ruma::ServerName
source · 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§
source§impl ServerName
impl ServerName
source§impl 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.
source§impl ServerName
impl ServerName
Trait Implementations§
source§impl AsRef<[u8]> for ServerName
impl AsRef<[u8]> for ServerName
source§impl AsRef<ServerName> for OwnedServerName
impl AsRef<ServerName> for OwnedServerName
source§fn as_ref(&self) -> &ServerName
fn as_ref(&self) -> &ServerName
Converts this type into a shared reference of the (usually inferred) input type.
source§impl AsRef<str> for ServerName
impl AsRef<str> for ServerName
source§impl Borrow<ServerName> for OwnedServerName
impl Borrow<ServerName> for OwnedServerName
source§fn borrow(&self) -> &ServerName
fn borrow(&self) -> &ServerName
Immutably borrows from an owned value. Read more
source§impl Debug for ServerName
impl Debug for ServerName
source§impl<'de> Deserialize<'de> for Box<ServerName, Global>
impl<'de> Deserialize<'de> for Box<ServerName, Global>
source§fn 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
source§impl Display for ServerName
impl Display for ServerName
source§impl From<&ServerName> for Arc<ServerName>
impl From<&ServerName> for Arc<ServerName>
source§fn from(s: &ServerName) -> Arc<ServerName>
fn from(s: &ServerName) -> Arc<ServerName>
Converts to this type from the input type.
source§impl From<&ServerName> for Box<ServerName, Global>
impl From<&ServerName> for Box<ServerName, Global>
source§fn from(id: &ServerName) -> Box<ServerName, Global>
fn from(id: &ServerName) -> Box<ServerName, Global>
Converts to this type from the input type.
source§impl From<&ServerName> for OwnedServerName
impl From<&ServerName> for OwnedServerName
source§fn from(id: &ServerName) -> OwnedServerName
fn from(id: &ServerName) -> OwnedServerName
Converts to this type from the input type.
source§impl From<&ServerName> for Rc<ServerName>
impl From<&ServerName> for Rc<ServerName>
source§fn from(s: &ServerName) -> Rc<ServerName>
fn from(s: &ServerName) -> Rc<ServerName>
Converts to this type from the input type.
source§impl From<&ServerName> for String
impl From<&ServerName> for String
source§fn from(id: &ServerName) -> String
fn from(id: &ServerName) -> String
Converts to this type from the input type.
source§impl From<OwnedServerName> for Box<ServerName, Global>
impl From<OwnedServerName> for Box<ServerName, Global>
source§fn from(a: OwnedServerName) -> Box<ServerName, Global>
fn from(a: OwnedServerName) -> Box<ServerName, Global>
Converts to this type from the input type.
source§impl Hash for ServerName
impl Hash for ServerName
source§impl Ord for ServerName
impl Ord for ServerName
source§impl PartialEq<&ServerName> for OwnedServerName
impl PartialEq<&ServerName> for OwnedServerName
source§fn 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 ==
.source§impl PartialEq<&str> for ServerName
impl PartialEq<&str> for ServerName
source§impl PartialEq<Box<ServerName, Global>> for &ServerName
impl PartialEq<Box<ServerName, Global>> for &ServerName
source§impl PartialEq<Box<ServerName, Global>> for ServerName
impl PartialEq<Box<ServerName, Global>> for ServerName
source§impl PartialEq<OwnedServerName> for &ServerName
impl PartialEq<OwnedServerName> for &ServerName
source§fn eq(&self, other: &OwnedServerName) -> bool
fn eq(&self, other: &OwnedServerName) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<OwnedServerName> for ServerName
impl PartialEq<OwnedServerName> for ServerName
source§fn eq(&self, other: &OwnedServerName) -> bool
fn eq(&self, other: &OwnedServerName) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<ServerName> for &str
impl PartialEq<ServerName> for &str
source§fn 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 ==
.source§impl PartialEq<ServerName> for OwnedServerName
impl PartialEq<ServerName> for OwnedServerName
source§fn 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 ==
.source§impl PartialEq<ServerName> for ServerName
impl PartialEq<ServerName> for ServerName
source§fn 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 ==
.source§impl PartialEq<ServerName> for str
impl PartialEq<ServerName> for str
source§fn 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 ==
.source§impl PartialEq<String> for ServerName
impl PartialEq<String> for ServerName
source§impl PartialEq<str> for ServerName
impl PartialEq<str> for ServerName
source§impl PartialOrd<ServerName> for ServerName
impl PartialOrd<ServerName> for ServerName
source§fn partial_cmp(&self, other: &ServerName) -> Option<Ordering>
fn partial_cmp(&self, other: &ServerName) -> Option<Ordering>
1.0.0 · source§fn 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 moresource§impl Serialize for ServerName
impl Serialize for ServerName
source§fn 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
source§impl ToOwned for ServerName
impl ToOwned for ServerName
§type Owned = OwnedServerName
type Owned = OwnedServerName
The resulting type after obtaining ownership.
source§fn 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 · source§fn 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