Struct matrix_sdk::ruma::OwnedRoomId
source · 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) -> Option<&ServerName>
pub fn server_name(&self) -> Option<&ServerName>
Returns the server name of the room ID.
sourcepub fn matrix_to_uri(&self) -> MatrixToUri
pub fn matrix_to_uri(&self) -> MatrixToUri
Create a matrix.to
URI for this room ID.
Note that it is recommended to provide servers that should know the room to be able to find
it with its room ID. For that use RoomId::matrix_to_uri_via()
.
§Example
use ruma_common::{room_id, server_name};
assert_eq!(
room_id!("!somewhere:example.org").matrix_to_uri().to_string(),
"https://matrix.to/#/!somewhere:example.org"
);
sourcepub fn matrix_to_uri_via<T>(&self, via: T) -> MatrixToUri
pub fn matrix_to_uri_via<T>(&self, via: T) -> MatrixToUri
Create a matrix.to
URI for this room ID with a list of servers that should know it.
To get the list of servers, it is recommended to use the routing algorithm from the spec.
If you don’t have a list of servers, you can use RoomId::matrix_to_uri()
instead.
§Example
use ruma_common::{room_id, server_name};
assert_eq!(
room_id!("!somewhere:example.org")
.matrix_to_uri_via([&*server_name!("example.org"), &*server_name!("alt.example.org")])
.to_string(),
"https://matrix.to/#/!somewhere:example.org?via=example.org&via=alt.example.org"
);
sourcepub 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 ID.
Note that it is recommended to provide servers that should know the room to be able to find
it with its room ID. For that use RoomId::matrix_to_event_uri_via()
.
sourcepub fn matrix_to_event_uri_via<T>(
&self,
ev_id: impl Into<OwnedEventId>,
via: T,
) -> MatrixToUri
pub fn matrix_to_event_uri_via<T>( &self, ev_id: impl Into<OwnedEventId>, via: T, ) -> MatrixToUri
Create a matrix.to
URI for an event scoped under this room ID with a list of servers that
should know it.
To get the list of servers, it is recommended to use the routing algorithm from the spec.
If you don’t have a list of servers, you can use RoomId::matrix_to_event_uri()
instead.
sourcepub fn matrix_uri(&self, join: bool) -> MatrixUri
pub fn matrix_uri(&self, join: bool) -> MatrixUri
Create a matrix:
URI for this room ID.
If join
is true
, a click on the URI should join the room.
Note that it is recommended to provide servers that should know the room to be able to find
it with its room ID. For that use RoomId::matrix_uri_via()
.
§Example
use ruma_common::{room_id, server_name};
assert_eq!(
room_id!("!somewhere:example.org").matrix_uri(false).to_string(),
"matrix:roomid/somewhere:example.org"
);
sourcepub fn matrix_uri_via<T>(&self, via: T, join: bool) -> MatrixUri
pub fn matrix_uri_via<T>(&self, via: T, join: bool) -> MatrixUri
Create a matrix:
URI for this room ID with a list of servers that should know it.
To get the list of servers, it is recommended to use the routing algorithm from the spec.
If you don’t have a list of servers, you can use RoomId::matrix_uri()
instead.
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_via(
[&*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(&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 ID.
Note that it is recommended to provide servers that should know the room to be able to find
it with its room ID. For that use RoomId::matrix_event_uri_via()
.
sourcepub fn matrix_event_uri_via<T>(
&self,
ev_id: impl Into<OwnedEventId>,
via: T,
) -> MatrixUri
pub fn matrix_event_uri_via<T>( &self, ev_id: impl Into<OwnedEventId>, via: T, ) -> MatrixUri
Create a matrix:
URI for an event scoped under this room ID with a list of servers that
should know it.
To get the list of servers, it is recommended to use the routing algorithm from the spec.
If you don’t have a list of servers, you can use RoomId::matrix_event_uri()
instead.
Trait Implementations§
source§impl AsRef<[u8]> for OwnedRoomId
impl AsRef<[u8]> for OwnedRoomId
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
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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>,
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
source§impl From<OwnedRoomId> for MatrixId
impl From<OwnedRoomId> for MatrixId
source§fn from(room_id: OwnedRoomId) -> MatrixId
fn from(room_id: OwnedRoomId) -> MatrixId
source§impl From<OwnedRoomId> for OwnedRoomOrAliasId
impl From<OwnedRoomId> for OwnedRoomOrAliasId
source§fn from(room_id: OwnedRoomId) -> OwnedRoomOrAliasId
fn from(room_id: OwnedRoomId) -> OwnedRoomOrAliasId
source§impl From<OwnedRoomId> for String
impl From<OwnedRoomId> for String
source§fn from(id: OwnedRoomId) -> String
fn from(id: OwnedRoomId) -> String
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,
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<Arc<RoomId>> for OwnedRoomId
impl PartialEq<Arc<RoomId>> for OwnedRoomId
source§impl PartialEq<Box<RoomId>> for OwnedRoomId
impl PartialEq<Box<RoomId>> for OwnedRoomId
source§impl PartialEq<OwnedRoomId> for &RoomId
impl PartialEq<OwnedRoomId> for &RoomId
source§fn eq(&self, other: &OwnedRoomId) -> bool
fn eq(&self, other: &OwnedRoomId) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<OwnedRoomId> for &str
impl PartialEq<OwnedRoomId> for &str
source§fn eq(&self, other: &OwnedRoomId) -> bool
fn eq(&self, other: &OwnedRoomId) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<OwnedRoomId> for Box<RoomId>
impl PartialEq<OwnedRoomId> for Box<RoomId>
source§fn eq(&self, other: &OwnedRoomId) -> bool
fn eq(&self, other: &OwnedRoomId) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<OwnedRoomId> for RoomId
impl PartialEq<OwnedRoomId> for RoomId
source§fn eq(&self, other: &OwnedRoomId) -> bool
fn eq(&self, other: &OwnedRoomId) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<OwnedRoomId> for str
impl PartialEq<OwnedRoomId> for str
source§fn eq(&self, other: &OwnedRoomId) -> bool
fn eq(&self, other: &OwnedRoomId) -> bool
self
and other
values to be equal, and is used
by ==
.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§fn eq(&self, other: &OwnedRoomId) -> bool
fn eq(&self, other: &OwnedRoomId) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for OwnedRoomId
impl PartialOrd for OwnedRoomId
source§fn partial_cmp(&self, other: &OwnedRoomId) -> Option<Ordering>
fn partial_cmp(&self, other: &OwnedRoomId) -> 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 moresource§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,
source§impl TryFrom<&str> for OwnedRoomId
impl TryFrom<&str> for OwnedRoomId
source§impl TryFrom<OwnedRoomOrAliasId> for OwnedRoomId
impl TryFrom<OwnedRoomOrAliasId> for OwnedRoomId
§type Error = OwnedRoomAliasId
type Error = OwnedRoomAliasId
source§fn try_from(id: OwnedRoomOrAliasId) -> Result<OwnedRoomId, OwnedRoomAliasId>
fn try_from(id: OwnedRoomOrAliasId) -> Result<OwnedRoomId, OwnedRoomAliasId>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more