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<String> for OwnedMxcUri
impl From<String> for OwnedMxcUri
sourceimpl Hash for OwnedMxcUri
impl Hash for OwnedMxcUri
sourceimpl Ord for OwnedMxcUri
impl Ord for OwnedMxcUri
sourceimpl PartialEq<&MxcUri> for OwnedMxcUri
impl PartialEq<&MxcUri> for OwnedMxcUri
sourceimpl PartialEq<&str> for OwnedMxcUri
impl PartialEq<&str> for OwnedMxcUri
sourceimpl PartialEq<MxcUri> for OwnedMxcUri
impl PartialEq<MxcUri> for OwnedMxcUri
sourceimpl PartialEq<OwnedMxcUri> for OwnedMxcUri
impl PartialEq<OwnedMxcUri> for OwnedMxcUri
sourceimpl PartialEq<OwnedMxcUri> for str
impl PartialEq<OwnedMxcUri> for str
sourceimpl PartialEq<OwnedMxcUri> for &str
impl PartialEq<OwnedMxcUri> for &str
sourceimpl PartialEq<OwnedMxcUri> for String
impl PartialEq<OwnedMxcUri> for String
sourceimpl PartialEq<OwnedMxcUri> for MxcUri
impl PartialEq<OwnedMxcUri> for MxcUri
sourceimpl PartialEq<OwnedMxcUri> for &MxcUri
impl PartialEq<OwnedMxcUri> for &MxcUri
sourceimpl PartialEq<OwnedMxcUri> for Box<MxcUri>
impl PartialEq<OwnedMxcUri> for Box<MxcUri>
sourceimpl PartialEq<String> for OwnedMxcUri
impl PartialEq<String> for OwnedMxcUri
sourceimpl PartialEq<str> for OwnedMxcUri
impl PartialEq<str> for OwnedMxcUri
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>
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
sourceimpl 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 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<T> CallHasher for T where
T: Hash + ?Sized,
impl<T> CallHasher for T where
T: Hash + ?Sized,
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.
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more