Struct crackle_lib::RoomAliasId
[−]#[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
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: &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.
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: &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.
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, Global>>
) -> Result<Box<RoomAliasId, Global>, Error>
pub fn parse_box(
s: impl AsRef<str> + Into<Box<str, Global>>
) -> Result<Box<RoomAliasId, Global>, 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.
Trait Implementations
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<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<'_> 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<'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 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<'_> PartialEq<Box<RoomAliasId, Global>> for &'_ RoomAliasId
impl<'_> PartialEq<Box<RoomAliasId, Global>> for &'_ RoomAliasId
impl PartialEq<Box<RoomAliasId, Global>> for RoomAliasId
impl PartialEq<Box<RoomAliasId, Global>> 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 RoomAliasId
impl PartialEq<RoomAliasId> for RoomAliasId
fn 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
fn ne(&self, other: &RoomAliasId) -> bool
fn ne(&self, other: &RoomAliasId) -> bool
This method tests for !=
.
impl PartialEq<RoomAliasId> for OwnedRoomAliasId
impl PartialEq<RoomAliasId> for OwnedRoomAliasId
impl PartialEq<RoomAliasId> for str
impl PartialEq<RoomAliasId> for str
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 PartialOrd<RoomAliasId> for RoomAliasId
impl PartialOrd<RoomAliasId> for RoomAliasId
fn 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
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
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
impl<'a> TryFrom<&'a RoomOrAliasId> for &'a RoomAliasId
impl<'a> TryFrom<&'a RoomOrAliasId> for &'a RoomAliasId
impl<'a> TryFrom<&'a str> for &'a RoomAliasId
impl<'a> TryFrom<&'a str> for &'a RoomAliasId
type Error = Error
type Error = Error
The type returned in the event of a conversion error.
fn try_from(
s: &'a str
) -> Result<&'a RoomAliasId, <&'a RoomAliasId as TryFrom<&'a str>>::Error>
fn try_from(
s: &'a str
) -> Result<&'a RoomAliasId, <&'a RoomAliasId as TryFrom<&'a str>>::Error>
Performs the conversion.
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
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<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.