Struct ruma_identifiers::RoomAliasId
source · [−]#[repr(transparent)]pub struct RoomAliasId(_);
Expand description
A Matrix room alias ID.
A RoomAliasId
is converted from a string slice, and can be converted back into a string as
needed.
assert_eq!(<&RoomAliasId>::try_from("#ruma:example.com").unwrap(), "#ruma:example.com");
Implementations
sourceimpl RoomAliasId
impl RoomAliasId
sourcepub fn parse(s: impl AsRef<str> + Into<Box<str>>) -> Result<Box<Self>, Error>
pub fn parse(s: impl AsRef<str> + Into<Box<str>>) -> Result<Box<Self>, Error>
Try parsing a &str
into a Box<RoomAliasId>
.
The same can also be done using FromStr
, TryFrom
or TryInto
.
This function is simply more constrained and thus useful in generic contexts.
sourceimpl RoomAliasId
impl RoomAliasId
sourceimpl RoomAliasId
impl RoomAliasId
sourcepub fn server_name(&self) -> &ServerName
pub fn server_name(&self) -> &ServerName
Returns the server name of the room alias ID.
sourcepub fn matrix_to_uri(&self) -> MatrixToUri
pub fn matrix_to_uri(&self) -> MatrixToUri
Create a matrix.to
URI for this room alias ID.
sourcepub fn matrix_to_event_uri(&self, ev_id: &EventId) -> MatrixToUri
pub fn matrix_to_event_uri(&self, ev_id: &EventId) -> MatrixToUri
Create a matrix.to
URI for an event scoped under this room alias ID.
sourcepub fn matrix_uri(&self, join: bool) -> MatrixUri
pub fn matrix_uri(&self, join: bool) -> MatrixUri
Create a matrix:
URI for this room alias ID.
If join
is true
, a click on the URI should join the room.
sourcepub fn matrix_event_uri(&self, ev_id: &EventId) -> MatrixUri
pub fn matrix_event_uri(&self, ev_id: &EventId) -> MatrixUri
Create a matrix:
URI for an event scoped under this room alias ID.
Trait Implementations
sourceimpl AsRef<str> for RoomAliasId
impl AsRef<str> for RoomAliasId
sourceimpl Debug for RoomAliasId
impl Debug for RoomAliasId
sourceimpl Display for RoomAliasId
impl Display for RoomAliasId
sourceimpl From<&'_ RoomAliasId> for MatrixId
impl From<&'_ RoomAliasId> for MatrixId
sourcefn from(room_alias: &RoomAliasId) -> Self
fn from(room_alias: &RoomAliasId) -> Self
Converts to this type from the input type.
sourceimpl From<&'_ RoomAliasId> for Box<RoomAliasId>
impl From<&'_ RoomAliasId> for Box<RoomAliasId>
sourcefn from(id: &RoomAliasId) -> Self
fn from(id: &RoomAliasId) -> Self
Converts to this type from the input type.
sourceimpl From<&'_ RoomAliasId> for Rc<RoomAliasId>
impl From<&'_ RoomAliasId> for Rc<RoomAliasId>
sourcefn from(s: &RoomAliasId) -> Rc<RoomAliasId>
fn from(s: &RoomAliasId) -> Rc<RoomAliasId>
Converts to this type from the input type.
sourceimpl From<&'_ RoomAliasId> for Arc<RoomAliasId>
impl From<&'_ RoomAliasId> for Arc<RoomAliasId>
sourcefn from(s: &RoomAliasId) -> Arc<RoomAliasId>
fn from(s: &RoomAliasId) -> Arc<RoomAliasId>
Converts to this type from the input type.
sourceimpl<'a> From<&'a RoomAliasId> for &'a RoomOrAliasId
impl<'a> From<&'a RoomAliasId> for &'a RoomOrAliasId
sourcefn from(room_alias_id: &'a RoomAliasId) -> Self
fn from(room_alias_id: &'a RoomAliasId) -> Self
Converts to this type from the input type.
sourceimpl Hash for RoomAliasId
impl Hash for RoomAliasId
sourceimpl Ord for RoomAliasId
impl Ord for RoomAliasId
sourceimpl PartialEq<&'_ RoomAliasId> for Box<RoomAliasId>
impl PartialEq<&'_ RoomAliasId> for Box<RoomAliasId>
sourceimpl PartialEq<&'_ str> for RoomAliasId
impl PartialEq<&'_ str> for RoomAliasId
sourceimpl PartialEq<Box<RoomAliasId, Global>> for RoomAliasId
impl PartialEq<Box<RoomAliasId, Global>> for RoomAliasId
sourceimpl PartialEq<Box<RoomAliasId, Global>> for &RoomAliasId
impl PartialEq<Box<RoomAliasId, Global>> for &RoomAliasId
sourceimpl PartialEq<RoomAliasId> for RoomAliasId
impl PartialEq<RoomAliasId> for RoomAliasId
sourcefn eq(&self, other: &RoomAliasId) -> bool
fn eq(&self, other: &RoomAliasId) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &RoomAliasId) -> bool
fn ne(&self, other: &RoomAliasId) -> bool
This method tests for !=
.
sourceimpl PartialEq<RoomAliasId> for Box<RoomAliasId>
impl PartialEq<RoomAliasId> for Box<RoomAliasId>
sourceimpl PartialEq<RoomAliasId> for str
impl PartialEq<RoomAliasId> for str
sourceimpl PartialEq<RoomAliasId> for &str
impl PartialEq<RoomAliasId> for &str
sourceimpl PartialEq<RoomAliasId> for String
impl PartialEq<RoomAliasId> for String
sourceimpl PartialEq<String> for RoomAliasId
impl PartialEq<String> for RoomAliasId
sourceimpl PartialEq<str> for RoomAliasId
impl PartialEq<str> for RoomAliasId
sourceimpl PartialOrd<RoomAliasId> for RoomAliasId
impl PartialOrd<RoomAliasId> for RoomAliasId
sourcefn partial_cmp(&self, other: &RoomAliasId) -> Option<Ordering>
fn partial_cmp(&self, other: &RoomAliasId) -> 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 RoomAliasId
Available on crate feature serde
only.
impl Serialize for RoomAliasId
serde
only.sourceimpl ToOwned for RoomAliasId
impl ToOwned for RoomAliasId
type Owned = Box<RoomAliasId, Global>
type Owned = Box<RoomAliasId, Global>
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
sourcefn clone_into(&self, target: &mut Self::Owned)
fn clone_into(&self, target: &mut Self::Owned)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<'a> TryFrom<&'a RoomOrAliasId> for &'a RoomAliasId
impl<'a> TryFrom<&'a RoomOrAliasId> for &'a RoomAliasId
sourcefn try_from(id: &'a RoomOrAliasId) -> Result<&'a RoomAliasId, &'a RoomId>
fn try_from(id: &'a RoomOrAliasId) -> Result<&'a RoomAliasId, &'a RoomId>
Performs the conversion.