Struct matrix_sdk::ruma::OwnedMxcUri
source · pub struct OwnedMxcUri { /* private fields */ }
Expand description
Owned variant of MxcUri
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 = MxcUri>§
sourcepub fn media_id(&self) -> Result<&str, MxcUriError>
pub fn media_id(&self) -> Result<&str, MxcUriError>
If this is a valid MXC URI, returns the media ID.
sourcepub fn server_name(&self) -> Result<&ServerName, MxcUriError>
pub fn server_name(&self) -> Result<&ServerName, MxcUriError>
If this is a valid MXC URI, returns the server name.
sourcepub fn parts(&self) -> Result<(&ServerName, &str), MxcUriError>
pub fn parts(&self) -> Result<(&ServerName, &str), MxcUriError>
If this is a valid MXC URI, returns a (server_name, media_id)
tuple, else it returns the
error.
sourcepub fn validate(&self) -> Result<(), MxcUriError>
pub fn validate(&self) -> Result<(), MxcUriError>
Validates the URI and returns an error if it failed.
Trait Implementations§
source§impl AsRef<[u8]> for OwnedMxcUri
impl AsRef<[u8]> for OwnedMxcUri
source§impl AsRef<MxcUri> for OwnedMxcUri
impl AsRef<MxcUri> for OwnedMxcUri
source§impl AsRef<str> for OwnedMxcUri
impl AsRef<str> for OwnedMxcUri
source§impl Borrow<MxcUri> for OwnedMxcUri
impl Borrow<MxcUri> for OwnedMxcUri
source§impl Clone for OwnedMxcUri
impl Clone for OwnedMxcUri
source§fn clone(&self) -> OwnedMxcUri
fn clone(&self) -> OwnedMxcUri
Returns a copy 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 OwnedMxcUri
impl Debug for OwnedMxcUri
source§impl Deref for OwnedMxcUri
impl Deref for OwnedMxcUri
source§impl<'de> Deserialize<'de> for OwnedMxcUri
impl<'de> Deserialize<'de> for OwnedMxcUri
source§fn deserialize<D>(
deserializer: D,
) -> Result<OwnedMxcUri, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<OwnedMxcUri, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for OwnedMxcUri
impl Display for OwnedMxcUri
source§impl From<&MxcUri> for OwnedMxcUri
impl From<&MxcUri> for OwnedMxcUri
source§fn from(id: &MxcUri) -> OwnedMxcUri
fn from(id: &MxcUri) -> OwnedMxcUri
Converts to this type from the input type.
source§impl From<&str> for OwnedMxcUri
impl From<&str> for OwnedMxcUri
source§fn from(s: &str) -> OwnedMxcUri
fn from(s: &str) -> OwnedMxcUri
Converts to this type from the input type.
source§impl From<OwnedMxcUri> for String
impl From<OwnedMxcUri> for String
source§fn from(id: OwnedMxcUri) -> String
fn from(id: OwnedMxcUri) -> String
Converts to this type from the input type.
source§impl From<String> for OwnedMxcUri
impl From<String> for OwnedMxcUri
source§fn from(s: String) -> OwnedMxcUri
fn from(s: String) -> OwnedMxcUri
Converts to this type from the input type.
source§impl Hash for OwnedMxcUri
impl Hash for OwnedMxcUri
source§impl Ord for OwnedMxcUri
impl Ord for OwnedMxcUri
source§fn cmp(&self, other: &OwnedMxcUri) -> Ordering
fn cmp(&self, other: &OwnedMxcUri) -> 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<&MxcUri> for OwnedMxcUri
impl PartialEq<&MxcUri> for OwnedMxcUri
source§impl PartialEq<&str> for OwnedMxcUri
impl PartialEq<&str> for OwnedMxcUri
source§impl PartialEq<Arc<MxcUri>> for OwnedMxcUri
impl PartialEq<Arc<MxcUri>> for OwnedMxcUri
source§impl PartialEq<Box<MxcUri>> for OwnedMxcUri
impl PartialEq<Box<MxcUri>> for OwnedMxcUri
source§impl PartialEq<MxcUri> for OwnedMxcUri
impl PartialEq<MxcUri> for OwnedMxcUri
source§impl PartialEq<OwnedMxcUri> for &MxcUri
impl PartialEq<OwnedMxcUri> for &MxcUri
source§fn eq(&self, other: &OwnedMxcUri) -> bool
fn eq(&self, other: &OwnedMxcUri) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<OwnedMxcUri> for &str
impl PartialEq<OwnedMxcUri> for &str
source§fn eq(&self, other: &OwnedMxcUri) -> bool
fn eq(&self, other: &OwnedMxcUri) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<OwnedMxcUri> for Box<MxcUri>
impl PartialEq<OwnedMxcUri> for Box<MxcUri>
source§fn eq(&self, other: &OwnedMxcUri) -> bool
fn eq(&self, other: &OwnedMxcUri) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<OwnedMxcUri> for MxcUri
impl PartialEq<OwnedMxcUri> for MxcUri
source§fn eq(&self, other: &OwnedMxcUri) -> bool
fn eq(&self, other: &OwnedMxcUri) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<OwnedMxcUri> for str
impl PartialEq<OwnedMxcUri> for str
source§fn eq(&self, other: &OwnedMxcUri) -> bool
fn eq(&self, other: &OwnedMxcUri) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<String> for OwnedMxcUri
impl PartialEq<String> for OwnedMxcUri
source§impl PartialEq<str> for OwnedMxcUri
impl PartialEq<str> for OwnedMxcUri
source§impl PartialEq for OwnedMxcUri
impl PartialEq for OwnedMxcUri
source§fn eq(&self, other: &OwnedMxcUri) -> bool
fn eq(&self, other: &OwnedMxcUri) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for OwnedMxcUri
impl PartialOrd for OwnedMxcUri
source§fn partial_cmp(&self, other: &OwnedMxcUri) -> Option<Ordering>
fn partial_cmp(&self, other: &OwnedMxcUri) -> Option<Ordering>
1.0.0 · source§fn 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 moresource§impl Serialize for OwnedMxcUri
impl Serialize for OwnedMxcUri
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
impl Eq for OwnedMxcUri
Auto Trait Implementations§
impl Freeze for OwnedMxcUri
impl RefUnwindSafe for OwnedMxcUri
impl Send for OwnedMxcUri
impl Sync for OwnedMxcUri
impl Unpin for OwnedMxcUri
impl UnwindSafe for OwnedMxcUri
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
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
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<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>
Converts
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>
Converts
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