Struct RoomAliasId
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§
§impl RoomAliasId
impl RoomAliasId
§impl RoomAliasId
impl RoomAliasId
§impl RoomAliasId
impl RoomAliasId
pub fn server_name(&self) -> &ServerName
pub fn server_name(&self) -> &ServerName
Returns the server name of the room alias ID.
pub fn matrix_to_uri(&self) -> MatrixToUri
pub fn matrix_to_uri(&self) -> MatrixToUri
Create a matrix.to URI for this room alias ID.
pub 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.
pub 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.
pub 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§
§impl AsRef<[u8]> for RoomAliasId
impl AsRef<[u8]> for RoomAliasId
§impl AsRef<RoomAliasId> for OwnedRoomAliasId
impl AsRef<RoomAliasId> for OwnedRoomAliasId
§fn as_ref(&self) -> &RoomAliasId
fn as_ref(&self) -> &RoomAliasId
Converts this type into a shared reference of the (usually inferred) input type.
§impl AsRef<RoomAliasId> for RoomAliasId
impl AsRef<RoomAliasId> for RoomAliasId
§fn as_ref(&self) -> &RoomAliasId
fn as_ref(&self) -> &RoomAliasId
Converts this type into a shared reference of the (usually inferred) input type.
§impl AsRef<str> for RoomAliasId
impl AsRef<str> for RoomAliasId
§impl Borrow<RoomAliasId> for OwnedRoomAliasId
impl Borrow<RoomAliasId> for OwnedRoomAliasId
§fn borrow(&self) -> &RoomAliasId
fn borrow(&self) -> &RoomAliasId
Immutably borrows from an owned value. Read more
§impl Debug for RoomAliasId
impl Debug for RoomAliasId
§impl Display for RoomAliasId
impl Display for RoomAliasId
§impl<'a> From<&'a RoomAliasId> for &'a RoomOrAliasId
impl<'a> From<&'a RoomAliasId> for &'a RoomOrAliasId
§fn from(room_alias_id: &'a RoomAliasId) -> &'a RoomOrAliasId
fn from(room_alias_id: &'a RoomAliasId) -> &'a RoomOrAliasId
Converts to this type from the input type.
§impl From<&RoomAliasId> for MatrixId
impl From<&RoomAliasId> for MatrixId
§fn from(room_alias: &RoomAliasId) -> MatrixId
fn from(room_alias: &RoomAliasId) -> MatrixId
Converts to this type from the input type.
§impl From<&RoomAliasId> for OwnedRoomAliasId
impl From<&RoomAliasId> for OwnedRoomAliasId
§fn from(id: &RoomAliasId) -> OwnedRoomAliasId
fn from(id: &RoomAliasId) -> OwnedRoomAliasId
Converts to this type from the input type.
§impl From<&RoomAliasId> for String
impl From<&RoomAliasId> for String
§fn from(id: &RoomAliasId) -> String
fn from(id: &RoomAliasId) -> String
Converts to this type from the input type.
§impl Hash for RoomAliasId
impl Hash for RoomAliasId
§impl Ord for RoomAliasId
impl Ord for RoomAliasId
§impl PartialEq<&RoomAliasId> for OwnedRoomAliasId
impl PartialEq<&RoomAliasId> for OwnedRoomAliasId
§impl PartialEq<&str> for RoomAliasId
impl PartialEq<&str> for RoomAliasId
§impl<'a> PartialEq<Cow<'a, str>> for RoomAliasId
impl<'a> PartialEq<Cow<'a, str>> for RoomAliasId
§impl PartialEq<OwnedRoomAliasId> for &RoomAliasId
impl PartialEq<OwnedRoomAliasId> for &RoomAliasId
§impl PartialEq<OwnedRoomAliasId> for RoomAliasId
impl PartialEq<OwnedRoomAliasId> for RoomAliasId
§impl PartialEq<RoomAliasId> for &str
impl PartialEq<RoomAliasId> for &str
§impl PartialEq<RoomAliasId> for OwnedRoomAliasId
impl PartialEq<RoomAliasId> for OwnedRoomAliasId
§impl PartialEq<RoomAliasId> for String
impl PartialEq<RoomAliasId> for String
§impl PartialEq<RoomAliasId> for str
impl PartialEq<RoomAliasId> for str
§impl PartialEq<String> for RoomAliasId
impl PartialEq<String> for RoomAliasId
§impl PartialEq<str> for RoomAliasId
impl PartialEq<str> for RoomAliasId
§impl PartialEq for RoomAliasId
impl PartialEq for RoomAliasId
§impl PartialOrd for RoomAliasId
impl PartialOrd for RoomAliasId
§impl Serialize for RoomAliasId
impl Serialize for RoomAliasId
§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
§impl ToOwned for RoomAliasId
impl ToOwned for RoomAliasId
§type Owned = OwnedRoomAliasId
type Owned = OwnedRoomAliasId
The resulting type after obtaining ownership.
§fn to_owned(&self) -> <RoomAliasId as ToOwned>::Owned
fn to_owned(&self) -> <RoomAliasId 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
§impl<'a> TryFrom<&'a RoomOrAliasId> for &'a RoomAliasId
impl<'a> TryFrom<&'a RoomOrAliasId> for &'a RoomAliasId
§fn try_from(id: &'a RoomOrAliasId) -> Result<&'a RoomAliasId, &'a RoomId>
fn try_from(id: &'a RoomOrAliasId) -> Result<&'a RoomAliasId, &'a RoomId>
Performs the conversion.
§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 UnsafeUnpin 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
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.