Struct matrix_sdk_base::ruma::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
pub 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.
pub 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.
§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
pub fn matrix_to_event_uri(&self, ev_id: impl Into<OwnedEventId>) -> MatrixToUri
Create a matrix.to
URI for an event scoped under this room alias ID.
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
pub fn matrix_event_uri(&self, ev_id: impl Into<OwnedEventId>) -> MatrixUri
Create a matrix:
URI for an event scoped under this room alias ID.
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
§impl AsRef<RoomAliasId> for RoomAliasId
impl AsRef<RoomAliasId> for RoomAliasId
§fn as_ref(&self) -> &RoomAliasId
fn as_ref(&self) -> &RoomAliasId
§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
§impl Clone for Box<RoomAliasId>
impl Clone for Box<RoomAliasId>
§fn clone(&self) -> Box<RoomAliasId>
fn clone(&self) -> Box<RoomAliasId>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for RoomAliasId
impl Debug for RoomAliasId
§impl<'de> Deserialize<'de> for Box<RoomAliasId>
impl<'de> Deserialize<'de> for Box<RoomAliasId>
§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>,
§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
§impl From<&RoomAliasId> for Arc<RoomAliasId>
impl From<&RoomAliasId> for Arc<RoomAliasId>
§fn from(s: &RoomAliasId) -> Arc<RoomAliasId>
fn from(s: &RoomAliasId) -> Arc<RoomAliasId>
§impl From<&RoomAliasId> for Box<RoomAliasId>
impl From<&RoomAliasId> for Box<RoomAliasId>
§fn from(id: &RoomAliasId) -> Box<RoomAliasId>
fn from(id: &RoomAliasId) -> Box<RoomAliasId>
§impl From<&RoomAliasId> for MatrixId
impl From<&RoomAliasId> for MatrixId
§fn from(room_alias: &RoomAliasId) -> MatrixId
fn from(room_alias: &RoomAliasId) -> MatrixId
§impl From<&RoomAliasId> for OwnedRoomAliasId
impl From<&RoomAliasId> for OwnedRoomAliasId
§fn from(id: &RoomAliasId) -> OwnedRoomAliasId
fn from(id: &RoomAliasId) -> OwnedRoomAliasId
§impl From<&RoomAliasId> for Rc<RoomAliasId>
impl From<&RoomAliasId> for Rc<RoomAliasId>
§fn from(s: &RoomAliasId) -> Rc<RoomAliasId>
fn from(s: &RoomAliasId) -> Rc<RoomAliasId>
§impl From<&RoomAliasId> for String
impl From<&RoomAliasId> for String
§fn from(id: &RoomAliasId) -> String
fn from(id: &RoomAliasId) -> String
§impl From<OwnedRoomAliasId> for Box<RoomAliasId>
impl From<OwnedRoomAliasId> for Box<RoomAliasId>
§fn from(a: OwnedRoomAliasId) -> Box<RoomAliasId>
fn from(a: OwnedRoomAliasId) -> Box<RoomAliasId>
§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
§fn eq(&self, other: &&RoomAliasId) -> bool
fn eq(&self, other: &&RoomAliasId) -> bool
self
and other
values to be equal, and is used
by ==
.§impl PartialEq<&str> for RoomAliasId
impl PartialEq<&str> for RoomAliasId
§impl PartialEq<Box<RoomAliasId>> for &RoomAliasId
impl PartialEq<Box<RoomAliasId>> for &RoomAliasId
§fn eq(&self, other: &Box<RoomAliasId>) -> bool
fn eq(&self, other: &Box<RoomAliasId>) -> bool
self
and other
values to be equal, and is used
by ==
.§impl PartialEq<Box<RoomAliasId>> for RoomAliasId
impl PartialEq<Box<RoomAliasId>> for RoomAliasId
§fn eq(&self, other: &Box<RoomAliasId>) -> bool
fn eq(&self, other: &Box<RoomAliasId>) -> bool
self
and other
values to be equal, and is used
by ==
.§impl PartialEq<OwnedRoomAliasId> for &RoomAliasId
impl PartialEq<OwnedRoomAliasId> for &RoomAliasId
§fn eq(&self, other: &OwnedRoomAliasId) -> bool
fn eq(&self, other: &OwnedRoomAliasId) -> bool
self
and other
values to be equal, and is used
by ==
.§impl PartialEq<OwnedRoomAliasId> for RoomAliasId
impl PartialEq<OwnedRoomAliasId> for RoomAliasId
§fn eq(&self, other: &OwnedRoomAliasId) -> bool
fn eq(&self, other: &OwnedRoomAliasId) -> bool
self
and other
values to be equal, and is used
by ==
.§impl PartialEq<RoomAliasId> for &str
impl PartialEq<RoomAliasId> for &str
§fn eq(&self, other: &RoomAliasId) -> bool
fn eq(&self, other: &RoomAliasId) -> bool
self
and other
values to be equal, and is used
by ==
.§impl PartialEq<RoomAliasId> for OwnedRoomAliasId
impl PartialEq<RoomAliasId> for OwnedRoomAliasId
§fn eq(&self, other: &RoomAliasId) -> bool
fn eq(&self, other: &RoomAliasId) -> bool
self
and other
values to be equal, and is used
by ==
.§impl PartialEq<RoomAliasId> for String
impl PartialEq<RoomAliasId> for String
§fn eq(&self, other: &RoomAliasId) -> bool
fn eq(&self, other: &RoomAliasId) -> bool
self
and other
values to be equal, and is used
by ==
.§impl PartialEq<RoomAliasId> for str
impl PartialEq<RoomAliasId> for str
§fn eq(&self, other: &RoomAliasId) -> bool
fn eq(&self, other: &RoomAliasId) -> bool
self
and other
values to be equal, and is used
by ==
.§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
§fn eq(&self, other: &RoomAliasId) -> bool
fn eq(&self, other: &RoomAliasId) -> bool
self
and other
values to be equal, and is used
by ==
.§impl PartialOrd for RoomAliasId
impl PartialOrd for RoomAliasId
§fn partial_cmp(&self, other: &RoomAliasId) -> Option<Ordering>
fn partial_cmp(&self, other: &RoomAliasId) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more§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,
§impl ToOwned for RoomAliasId
impl ToOwned for RoomAliasId
§type Owned = OwnedRoomAliasId
type Owned = OwnedRoomAliasId
§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)
§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>
§impl<'a> TryFrom<&'a str> for &'a RoomAliasId
impl<'a> TryFrom<&'a str> for &'a RoomAliasId
§impl TryFrom<&str> for Box<RoomAliasId>
impl TryFrom<&str> for Box<RoomAliasId>
§impl TryFrom<String> for Box<RoomAliasId>
impl TryFrom<String> for Box<RoomAliasId>
impl Eq for RoomAliasId
impl StructuralEq for RoomAliasId
impl StructuralPartialEq for RoomAliasId
Auto Trait Implementations§
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
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.