Struct ruma_common::ServerName
source · pub struct ServerName(/* private fields */);
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, IdParseError>
pub fn parse(s: impl AsRef<str>) -> Result<OwnedServerName, IdParseError>
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>>,
) -> Result<Box<Self>, IdParseError>
pub fn parse_box( s: impl AsRef<str> + Into<Box<str>>, ) -> Result<Box<Self>, IdParseError>
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<ServerName> for ServerName
impl AsRef<ServerName> for ServerName
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 Clone for Box<ServerName>
impl Clone for Box<ServerName>
source§impl Debug for ServerName
impl Debug for ServerName
source§impl<'de> Deserialize<'de> for Box<ServerName>
impl<'de> Deserialize<'de> for Box<ServerName>
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::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>
impl From<&ServerName> for Box<ServerName>
source§fn from(id: &ServerName) -> Self
fn from(id: &ServerName) -> Self
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) -> Self
fn from(id: &ServerName) -> Self
Converts to this type from the input type.
source§impl From<OwnedServerName> for Box<ServerName>
impl From<OwnedServerName> for Box<ServerName>
source§fn from(a: OwnedServerName) -> Box<ServerName>
fn from(a: OwnedServerName) -> Box<ServerName>
Converts to this type from the input type.
source§impl FromStr for Box<ServerName>
impl FromStr for Box<ServerName>
source§impl Hash for ServerName
impl Hash for ServerName
source§impl Ord for ServerName
impl Ord for ServerName
source§impl PartialEq<&ServerName> for Box<ServerName>
impl PartialEq<&ServerName> for Box<ServerName>
source§impl PartialEq<&ServerName> for OwnedServerName
impl PartialEq<&ServerName> for OwnedServerName
source§impl PartialEq<&str> for ServerName
impl PartialEq<&str> for ServerName
source§impl PartialEq<Box<ServerName>> for &ServerName
impl PartialEq<Box<ServerName>> for &ServerName
source§impl PartialEq<Box<ServerName>> for ServerName
impl PartialEq<Box<ServerName>> for ServerName
source§impl PartialEq<OwnedServerName> for &ServerName
impl PartialEq<OwnedServerName> for &ServerName
source§impl PartialEq<OwnedServerName> for Box<ServerName>
impl PartialEq<OwnedServerName> for Box<ServerName>
source§impl PartialEq<OwnedServerName> for ServerName
impl PartialEq<OwnedServerName> for ServerName
source§impl PartialEq<ServerName> for &str
impl PartialEq<ServerName> for &str
source§impl PartialEq<ServerName> for Box<ServerName>
impl PartialEq<ServerName> for Box<ServerName>
source§impl PartialEq<ServerName> for OwnedServerName
impl PartialEq<ServerName> for OwnedServerName
source§impl PartialEq<ServerName> for String
impl PartialEq<ServerName> for String
source§impl PartialEq<ServerName> for str
impl PartialEq<ServerName> for str
source§impl PartialEq<String> for ServerName
impl PartialEq<String> for ServerName
source§impl PartialEq<str> for ServerName
impl PartialEq<str> for ServerName
source§impl PartialEq for ServerName
impl PartialEq for ServerName
source§impl PartialOrd for ServerName
impl PartialOrd for ServerName
source§impl Serialize for ServerName
impl Serialize for ServerName
source§impl ToOwned for ServerName
impl ToOwned for ServerName
source§type Owned = OwnedServerName
type Owned = OwnedServerName
The resulting type after obtaining ownership.
source§fn to_owned(&self) -> Self::Owned
fn to_owned(&self) -> Self::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
source§impl<'a> TryFrom<&'a str> for &'a ServerName
impl<'a> TryFrom<&'a str> for &'a ServerName
impl Eq for ServerName
impl StructuralPartialEq for ServerName
Auto Trait Implementations§
impl Freeze for ServerName
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§
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.