Struct ruma_common::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
sourceimpl AsRef<MxcUri> for OwnedMxcUri
impl AsRef<MxcUri> for OwnedMxcUri
sourceimpl AsRef<str> for OwnedMxcUri
impl AsRef<str> for OwnedMxcUri
sourceimpl Borrow<MxcUri> for OwnedMxcUri
impl Borrow<MxcUri> for OwnedMxcUri
sourceimpl Clone for OwnedMxcUri
impl Clone for OwnedMxcUri
sourceimpl Debug for OwnedMxcUri
impl Debug for OwnedMxcUri
sourceimpl Deref for OwnedMxcUri
impl Deref for OwnedMxcUri
sourceimpl<'de> Deserialize<'de> for OwnedMxcUri
impl<'de> Deserialize<'de> for OwnedMxcUri
sourcefn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Display for OwnedMxcUri
impl Display for OwnedMxcUri
sourceimpl From<&MxcUri> for OwnedMxcUri
impl From<&MxcUri> for OwnedMxcUri
sourcefn from(id: &MxcUri) -> OwnedMxcUri
fn from(id: &MxcUri) -> OwnedMxcUri
Converts to this type from the input type.
sourceimpl From<&str> for OwnedMxcUri
impl From<&str> for OwnedMxcUri
sourceimpl From<Arc<MxcUri>> for OwnedMxcUri
impl From<Arc<MxcUri>> for OwnedMxcUri
sourcefn from(a: Arc<MxcUri>) -> OwnedMxcUri
fn from(a: Arc<MxcUri>) -> OwnedMxcUri
Converts to this type from the input type.
sourceimpl From<Box<MxcUri, Global>> for OwnedMxcUri
impl From<Box<MxcUri, Global>> for OwnedMxcUri
sourcefn from(b: Box<MxcUri>) -> OwnedMxcUri
fn from(b: Box<MxcUri>) -> OwnedMxcUri
Converts to this type from the input type.
sourceimpl From<OwnedMxcUri> for Arc<MxcUri>
impl From<OwnedMxcUri> for Arc<MxcUri>
sourcefn from(a: OwnedMxcUri) -> Arc<MxcUri>
fn from(a: OwnedMxcUri) -> Arc<MxcUri>
Converts to this type from the input type.
sourceimpl From<OwnedMxcUri> for Box<MxcUri>
impl From<OwnedMxcUri> for Box<MxcUri>
sourcefn from(a: OwnedMxcUri) -> Box<MxcUri>
fn from(a: OwnedMxcUri) -> Box<MxcUri>
Converts to this type from the input type.
sourceimpl From<String> for OwnedMxcUri
impl From<String> for OwnedMxcUri
sourceimpl Hash for OwnedMxcUri
impl Hash for OwnedMxcUri
sourceimpl Ord for OwnedMxcUri
impl Ord for OwnedMxcUri
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<Box<MxcUri, Global>> for OwnedMxcUri
impl PartialEq<Box<MxcUri, Global>> for OwnedMxcUri
sourceimpl PartialEq<OwnedMxcUri> for &MxcUri
impl PartialEq<OwnedMxcUri> for &MxcUri
sourcefn eq(&self, other: &OwnedMxcUri) -> bool
fn eq(&self, other: &OwnedMxcUri) -> bool
sourceimpl PartialEq<OwnedMxcUri> for &str
impl PartialEq<OwnedMxcUri> for &str
sourcefn eq(&self, other: &OwnedMxcUri) -> bool
fn eq(&self, other: &OwnedMxcUri) -> bool
sourceimpl PartialEq<OwnedMxcUri> for Arc<MxcUri>
impl PartialEq<OwnedMxcUri> for Arc<MxcUri>
sourcefn eq(&self, other: &OwnedMxcUri) -> bool
fn eq(&self, other: &OwnedMxcUri) -> bool
sourceimpl PartialEq<OwnedMxcUri> for Box<MxcUri>
impl PartialEq<OwnedMxcUri> for Box<MxcUri>
sourcefn eq(&self, other: &OwnedMxcUri) -> bool
fn eq(&self, other: &OwnedMxcUri) -> bool
sourceimpl PartialEq<OwnedMxcUri> for MxcUri
impl PartialEq<OwnedMxcUri> for MxcUri
sourcefn eq(&self, other: &OwnedMxcUri) -> bool
fn eq(&self, other: &OwnedMxcUri) -> bool
sourceimpl PartialEq<OwnedMxcUri> for OwnedMxcUri
impl PartialEq<OwnedMxcUri> for OwnedMxcUri
sourceimpl PartialEq<OwnedMxcUri> for String
impl PartialEq<OwnedMxcUri> for String
sourcefn eq(&self, other: &OwnedMxcUri) -> bool
fn eq(&self, other: &OwnedMxcUri) -> bool
sourceimpl PartialEq<OwnedMxcUri> for str
impl PartialEq<OwnedMxcUri> for str
sourcefn eq(&self, other: &OwnedMxcUri) -> bool
fn eq(&self, other: &OwnedMxcUri) -> bool
sourceimpl PartialOrd<OwnedMxcUri> for OwnedMxcUri
impl PartialOrd<OwnedMxcUri> for OwnedMxcUri
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
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 moresourceimpl Serialize for OwnedMxcUri
impl Serialize for OwnedMxcUri
impl Eq for OwnedMxcUri
Auto Trait Implementations
impl RefUnwindSafe for OwnedMxcUri
impl Send for OwnedMxcUri
impl Sync for OwnedMxcUri
impl Unpin for OwnedMxcUri
impl UnwindSafe for OwnedMxcUri
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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 Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
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.