pub struct OwnedRoomId { /* private fields */ }
Expand description
Owned variant of RoomId
The wrapper type for this type is variable, by default it’ll use Box
,
but you can change that by setting “--cfg=ruma_identifiers_storage=...
” using
RUSTFLAGS
or .cargo/config.toml
(under [build]
-> rustflags = ["..."]
)
to the following;
ruma_identifiers_storage="Arc"
to useArc
as a wrapper type.
Methods from Deref<Target = RoomId>§
Sourcepub fn server_name(&self) -> &ServerName
pub fn server_name(&self) -> &ServerName
Returns the server name of the room ID.
Sourcepub fn matrix_to_uri<'a>(
&self,
via: impl IntoIterator<Item = &'a ServerName>,
) -> MatrixToUri
pub fn matrix_to_uri<'a>( &self, via: impl IntoIterator<Item = &'a ServerName>, ) -> MatrixToUri
Create a matrix.to
URI for this room ID.
§Example
use ruma_common::{room_id, server_name};
assert_eq!(
room_id!("!somewhere:example.org")
.matrix_to_uri([&*server_name!("example.org"), &*server_name!("alt.example.org")])
.to_string(),
"https://matrix.to/#/%21somewhere%3Aexample.org?via=example.org&via=alt.example.org"
);
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 ID.
Sourcepub fn matrix_uri<'a>(
&self,
via: impl IntoIterator<Item = &'a ServerName>,
join: bool,
) -> MatrixUri
pub fn matrix_uri<'a>( &self, via: impl IntoIterator<Item = &'a ServerName>, join: bool, ) -> MatrixUri
Create a matrix:
URI for this room ID.
If join
is true
, a click on the URI should join the room.
§Example
use ruma_common::{room_id, server_name};
assert_eq!(
room_id!("!somewhere:example.org")
.matrix_uri([&*server_name!("example.org"), &*server_name!("alt.example.org")], true)
.to_string(),
"matrix:roomid/somewhere:example.org?via=example.org&via=alt.example.org&action=join"
);
Sourcepub fn matrix_event_uri<'a>(
&self,
ev_id: &EventId,
via: impl IntoIterator<Item = &'a ServerName>,
) -> MatrixUri
pub fn matrix_event_uri<'a>( &self, ev_id: &EventId, via: impl IntoIterator<Item = &'a ServerName>, ) -> MatrixUri
Create a matrix:
URI for an event scoped under this room ID.
Trait Implementations§
Source§impl AsRef<RoomId> for OwnedRoomId
impl AsRef<RoomId> for OwnedRoomId
Source§impl AsRef<str> for OwnedRoomId
impl AsRef<str> for OwnedRoomId
Source§impl Borrow<RoomId> for OwnedRoomId
impl Borrow<RoomId> for OwnedRoomId
Source§impl Clone for OwnedRoomId
impl Clone for OwnedRoomId
Source§fn clone(&self) -> OwnedRoomId
fn clone(&self) -> OwnedRoomId
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for OwnedRoomId
impl Debug for OwnedRoomId
Source§impl Deref for OwnedRoomId
impl Deref for OwnedRoomId
Source§impl<'de> Deserialize<'de> for OwnedRoomId
impl<'de> Deserialize<'de> for OwnedRoomId
Source§fn deserialize<D>(
deserializer: D,
) -> Result<OwnedRoomId, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<OwnedRoomId, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for OwnedRoomId
impl Display for OwnedRoomId
Source§impl From<&RoomId> for OwnedRoomId
impl From<&RoomId> for OwnedRoomId
Source§fn from(id: &RoomId) -> OwnedRoomId
fn from(id: &RoomId) -> OwnedRoomId
Converts to this type from the input type.
Source§impl FromStr for OwnedRoomId
impl FromStr for OwnedRoomId
Source§impl Hash for OwnedRoomId
impl Hash for OwnedRoomId
Source§impl Ord for OwnedRoomId
impl Ord for OwnedRoomId
Source§fn cmp(&self, other: &OwnedRoomId) -> Ordering
fn cmp(&self, other: &OwnedRoomId) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq<&RoomId> for OwnedRoomId
impl PartialEq<&RoomId> for OwnedRoomId
Source§impl PartialEq<&str> for OwnedRoomId
impl PartialEq<&str> for OwnedRoomId
Source§impl PartialEq<OwnedRoomId> for &RoomId
impl PartialEq<OwnedRoomId> for &RoomId
Source§impl PartialEq<OwnedRoomId> for &str
impl PartialEq<OwnedRoomId> for &str
Source§impl PartialEq<OwnedRoomId> for RoomId
impl PartialEq<OwnedRoomId> for RoomId
Source§impl PartialEq<OwnedRoomId> for str
impl PartialEq<OwnedRoomId> for str
Source§impl PartialEq<RoomId> for OwnedRoomId
impl PartialEq<RoomId> for OwnedRoomId
Source§impl PartialEq<String> for OwnedRoomId
impl PartialEq<String> for OwnedRoomId
Source§impl PartialEq<str> for OwnedRoomId
impl PartialEq<str> for OwnedRoomId
Source§impl PartialEq for OwnedRoomId
impl PartialEq for OwnedRoomId
Source§impl PartialOrd for OwnedRoomId
impl PartialOrd for OwnedRoomId
Source§impl Serialize for OwnedRoomId
impl Serialize for OwnedRoomId
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,
Serialize this value into the given Serde serializer. Read more
Source§impl TryFrom<&str> for OwnedRoomId
impl TryFrom<&str> for OwnedRoomId
Source§impl TryFrom<OwnedRoomOrAliasId> for OwnedRoomId
impl TryFrom<OwnedRoomOrAliasId> for OwnedRoomId
Source§type Error = OwnedRoomAliasId
type Error = OwnedRoomAliasId
The type returned in the event of a conversion error.
Source§fn try_from(id: OwnedRoomOrAliasId) -> Result<OwnedRoomId, OwnedRoomAliasId>
fn try_from(id: OwnedRoomOrAliasId) -> Result<OwnedRoomId, OwnedRoomAliasId>
Performs the conversion.
Source§impl TryFrom<String> for OwnedRoomId
impl TryFrom<String> for OwnedRoomId
impl Eq for OwnedRoomId
Auto Trait Implementations§
impl Freeze for OwnedRoomId
impl RefUnwindSafe for OwnedRoomId
impl Send for OwnedRoomId
impl Sync for OwnedRoomId
impl Unpin for OwnedRoomId
impl UnwindSafe for OwnedRoomId
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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.