Struct ruma_common::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, 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.
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 AsRef<str> for Box<ServerName>
impl AsRef<str> for Box<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>
impl Clone for Box<ServerName>
sourceimpl Debug for ServerName
impl Debug for ServerName
sourceimpl<'de> Deserialize<'de> for Box<ServerName>
impl<'de> Deserialize<'de> for Box<ServerName>
sourcefn 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
sourceimpl Display for ServerName
impl Display for ServerName
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) -> Self
fn from(id: &ServerName) -> Self
Converts to this type from the input type.
sourceimpl From<&ServerName> for Box<ServerName>
impl From<&ServerName> for Box<ServerName>
sourcefn from(id: &ServerName) -> Self
fn from(id: &ServerName) -> Self
Converts to this type from the input type.
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 FromStr for Box<ServerName>
impl FromStr for Box<ServerName>
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<&ServerName> for Box<ServerName>
impl PartialEq<&ServerName> for Box<ServerName>
sourceimpl PartialEq<&str> for ServerName
impl PartialEq<&str> for ServerName
sourceimpl PartialEq<&str> for Box<ServerName>
impl PartialEq<&str> for Box<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<OwnedServerName> for Box<ServerName>
impl PartialEq<OwnedServerName> for Box<ServerName>
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 OwnedServerName
impl PartialEq<ServerName> for OwnedServerName
sourceimpl PartialEq<ServerName> for Box<ServerName>
impl PartialEq<ServerName> for Box<ServerName>
sourceimpl PartialEq<ServerName> for str
impl PartialEq<ServerName> for str
sourceimpl PartialEq<ServerName> for &str
impl PartialEq<ServerName> for &str
sourceimpl PartialEq<ServerName> for String
impl PartialEq<ServerName> for String
sourceimpl PartialEq<String> for ServerName
impl PartialEq<String> for ServerName
sourceimpl PartialEq<String> for Box<ServerName>
impl PartialEq<String> for Box<ServerName>
sourceimpl PartialEq<str> for ServerName
impl PartialEq<str> for ServerName
sourceimpl PartialEq<str> for Box<ServerName>
impl PartialEq<str> for Box<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
sourceimpl ToOwned for ServerName
impl ToOwned for ServerName
type Owned = OwnedServerName
type Owned = OwnedServerName
The resulting type after obtaining ownership.
sourcefn 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 · 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
sourceimpl TryFrom<&str> for Box<ServerName>
impl TryFrom<&str> for Box<ServerName>
sourceimpl TryFrom<String> for Box<ServerName>
impl TryFrom<String> for Box<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.