pub struct RoomAliasId(/* private fields */);
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§
Source§impl RoomAliasId
impl RoomAliasId
Source§impl RoomAliasId
impl RoomAliasId
Sourcepub fn parse(s: impl AsRef<str>) -> Result<OwnedRoomAliasId, Error>
pub fn parse(s: impl AsRef<str>) -> Result<OwnedRoomAliasId, Error>
Try parsing a &str
into an OwnedRoomAliasId
.
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<RoomAliasId>, Error>
pub fn parse_box( s: impl AsRef<str> + Into<Box<str>>, ) -> Result<Box<RoomAliasId>, 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.
Source§impl 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: impl Into<OwnedEventId>) -> MatrixToUri
👎Deprecated: Use RoomId::matrix_to_event_uri
instead.
pub fn matrix_to_event_uri(&self, ev_id: impl Into<OwnedEventId>) -> MatrixToUri
RoomId::matrix_to_event_uri
instead.Create a matrix.to
URI for an event scoped under this room alias ID.
This is deprecated because room aliases are mutable, so the URI might break after a while.
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: impl Into<OwnedEventId>) -> MatrixUri
👎Deprecated: Use RoomId::matrix_event_uri
instead.
pub fn matrix_event_uri(&self, ev_id: impl Into<OwnedEventId>) -> MatrixUri
RoomId::matrix_event_uri
instead.Create a matrix:
URI for an event scoped under this room alias ID.
This is deprecated because room aliases are mutable, so the URI might break after a while.
Trait Implementations§
Source§impl AsRef<[u8]> for RoomAliasId
impl AsRef<[u8]> for RoomAliasId
Source§impl AsRef<RoomAliasId> for OwnedRoomAliasId
impl AsRef<RoomAliasId> for OwnedRoomAliasId
Source§fn as_ref(&self) -> &RoomAliasId
fn as_ref(&self) -> &RoomAliasId
Source§impl AsRef<RoomAliasId> for RoomAliasId
impl AsRef<RoomAliasId> for RoomAliasId
Source§fn as_ref(&self) -> &RoomAliasId
fn as_ref(&self) -> &RoomAliasId
Source§impl AsRef<str> for RoomAliasId
impl AsRef<str> for RoomAliasId
Source§impl Borrow<RoomAliasId> for OwnedRoomAliasId
impl Borrow<RoomAliasId> for OwnedRoomAliasId
Source§fn borrow(&self) -> &RoomAliasId
fn borrow(&self) -> &RoomAliasId
Source§impl Clone for Box<RoomAliasId>
impl Clone for Box<RoomAliasId>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for RoomAliasId
impl Debug for RoomAliasId
Source§impl<'de> Deserialize<'de> for Box<RoomAliasId>
impl<'de> Deserialize<'de> for Box<RoomAliasId>
Source§fn deserialize<D>(
deserializer: D,
) -> Result<Box<RoomAliasId>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Box<RoomAliasId>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Source§impl Display for RoomAliasId
impl Display for RoomAliasId
Source§impl<'a> From<&'a RoomAliasId> for &'a RoomOrAliasId
impl<'a> From<&'a RoomAliasId> for &'a RoomOrAliasId
Source§fn from(room_alias_id: &'a RoomAliasId) -> &'a RoomOrAliasId
fn from(room_alias_id: &'a RoomAliasId) -> &'a RoomOrAliasId
Source§impl From<&RoomAliasId> for Arc<RoomAliasId>
impl From<&RoomAliasId> for Arc<RoomAliasId>
Source§fn from(s: &RoomAliasId) -> Arc<RoomAliasId>
fn from(s: &RoomAliasId) -> Arc<RoomAliasId>
Source§impl From<&RoomAliasId> for Box<RoomAliasId>
impl From<&RoomAliasId> for Box<RoomAliasId>
Source§fn from(id: &RoomAliasId) -> Box<RoomAliasId>
fn from(id: &RoomAliasId) -> Box<RoomAliasId>
Source§impl From<&RoomAliasId> for MatrixId
impl From<&RoomAliasId> for MatrixId
Source§fn from(room_alias: &RoomAliasId) -> MatrixId
fn from(room_alias: &RoomAliasId) -> MatrixId
Source§impl From<&RoomAliasId> for OwnedRoomAliasId
impl From<&RoomAliasId> for OwnedRoomAliasId
Source§fn from(id: &RoomAliasId) -> OwnedRoomAliasId
fn from(id: &RoomAliasId) -> OwnedRoomAliasId
Source§impl From<&RoomAliasId> for Rc<RoomAliasId>
impl From<&RoomAliasId> for Rc<RoomAliasId>
Source§fn from(s: &RoomAliasId) -> Rc<RoomAliasId>
fn from(s: &RoomAliasId) -> Rc<RoomAliasId>
Source§impl From<&RoomAliasId> for String
impl From<&RoomAliasId> for String
Source§fn from(id: &RoomAliasId) -> String
fn from(id: &RoomAliasId) -> String
Source§impl From<OwnedRoomAliasId> for Box<RoomAliasId>
impl From<OwnedRoomAliasId> for Box<RoomAliasId>
Source§fn from(a: OwnedRoomAliasId) -> Box<RoomAliasId>
fn from(a: OwnedRoomAliasId) -> Box<RoomAliasId>
Source§impl FromStr for Box<RoomAliasId>
impl FromStr for Box<RoomAliasId>
Source§impl Hash for RoomAliasId
impl Hash for RoomAliasId
Source§impl Ord for RoomAliasId
impl Ord for RoomAliasId
Source§impl PartialEq<&RoomAliasId> for Box<RoomAliasId>
impl PartialEq<&RoomAliasId> for Box<RoomAliasId>
Source§impl PartialEq<&RoomAliasId> for OwnedRoomAliasId
impl PartialEq<&RoomAliasId> for OwnedRoomAliasId
Source§impl PartialEq<&str> for RoomAliasId
impl PartialEq<&str> for RoomAliasId
Source§impl PartialEq<Box<RoomAliasId>> for &RoomAliasId
impl PartialEq<Box<RoomAliasId>> for &RoomAliasId
Source§impl PartialEq<Box<RoomAliasId>> for RoomAliasId
impl PartialEq<Box<RoomAliasId>> for RoomAliasId
Source§impl PartialEq<OwnedRoomAliasId> for &RoomAliasId
impl PartialEq<OwnedRoomAliasId> for &RoomAliasId
Source§impl PartialEq<OwnedRoomAliasId> for Box<RoomAliasId>
impl PartialEq<OwnedRoomAliasId> for Box<RoomAliasId>
Source§impl PartialEq<OwnedRoomAliasId> for RoomAliasId
impl PartialEq<OwnedRoomAliasId> for RoomAliasId
Source§impl PartialEq<RoomAliasId> for &str
impl PartialEq<RoomAliasId> for &str
Source§impl PartialEq<RoomAliasId> for Box<RoomAliasId>
impl PartialEq<RoomAliasId> for Box<RoomAliasId>
Source§impl PartialEq<RoomAliasId> for OwnedRoomAliasId
impl PartialEq<RoomAliasId> for OwnedRoomAliasId
Source§impl PartialEq<RoomAliasId> for String
impl PartialEq<RoomAliasId> for String
Source§impl PartialEq<RoomAliasId> for str
impl PartialEq<RoomAliasId> for str
Source§impl PartialEq<String> for RoomAliasId
impl PartialEq<String> for RoomAliasId
Source§impl PartialEq<str> for RoomAliasId
impl PartialEq<str> for RoomAliasId
Source§impl PartialEq for RoomAliasId
impl PartialEq for RoomAliasId
Source§impl PartialOrd for RoomAliasId
impl PartialOrd for RoomAliasId
Source§impl Serialize for RoomAliasId
impl Serialize for RoomAliasId
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,
Source§impl ToOwned for RoomAliasId
impl ToOwned for RoomAliasId
Source§type Owned = OwnedRoomAliasId
type Owned = OwnedRoomAliasId
Source§fn to_owned(&self) -> <RoomAliasId as ToOwned>::Owned
fn to_owned(&self) -> <RoomAliasId as ToOwned>::Owned
1.63.0 · Source§fn clone_into(&self, target: &mut Self::Owned)
fn clone_into(&self, target: &mut Self::Owned)
Source§impl<'a> TryFrom<&'a RoomOrAliasId> for &'a RoomAliasId
impl<'a> TryFrom<&'a RoomOrAliasId> for &'a RoomAliasId
Source§impl<'a> TryFrom<&'a str> for &'a RoomAliasId
impl<'a> TryFrom<&'a str> for &'a RoomAliasId
impl Eq for RoomAliasId
impl StructuralPartialEq for RoomAliasId
Auto Trait Implementations§
impl Freeze for RoomAliasId
impl RefUnwindSafe for RoomAliasId
impl Send for RoomAliasId
impl !Sized for RoomAliasId
impl Sync for RoomAliasId
impl Unpin for RoomAliasId
impl UnwindSafe for RoomAliasId
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
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
key
and return true
if they are equal.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
key
and return true
if they are equal.