Struct ruma_common::MxcUri
source · pub struct MxcUri(/* private fields */);
Expand description
A URI that should be a Matrix-spec compliant MXC URI.
Implementations§
source§impl MxcUri
impl 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<MxcUri> for OwnedMxcUri
impl AsRef<MxcUri> for OwnedMxcUri
source§impl Borrow<MxcUri> for OwnedMxcUri
impl Borrow<MxcUri> for OwnedMxcUri
source§impl<'de> Deserialize<'de> for Box<MxcUri>
impl<'de> Deserialize<'de> for Box<MxcUri>
source§fn 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
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 PartialEq<&MxcUri> for OwnedMxcUri
impl PartialEq<&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§impl PartialEq<OwnedMxcUri> for MxcUri
impl PartialEq<OwnedMxcUri> for MxcUri
source§impl PartialOrd for MxcUri
impl PartialOrd for MxcUri
source§impl ToOwned for MxcUri
impl ToOwned for MxcUri
source§type Owned = OwnedMxcUri
type Owned = OwnedMxcUri
The resulting type after obtaining ownership.
source§fn to_owned(&self) -> Self::Owned
fn to_owned(&self) -> Self::Owned
Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · source§fn clone_into(&self, target: &mut Self::Owned)
fn clone_into(&self, target: &mut Self::Owned)
Uses borrowed data to replace owned data, usually by cloning. Read more
impl Eq for MxcUri
impl StructuralPartialEq for MxcUri
Auto Trait Implementations§
impl Freeze for MxcUri
impl RefUnwindSafe for MxcUri
impl Send for MxcUri
impl !Sized for MxcUri
impl Sync for MxcUri
impl Unpin for MxcUri
impl UnwindSafe for MxcUri
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<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.