Struct matrix_sdk::ruma::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<Box<MxcUri>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Box<MxcUri>, <D as Deserializer<'de>>::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 Box<MxcUri>
impl PartialEq<&MxcUri> for Box<MxcUri>
source§impl PartialEq<&MxcUri> for OwnedMxcUri
impl PartialEq<&MxcUri> for OwnedMxcUri
source§impl PartialEq<&str> for Box<MxcUri>
impl PartialEq<&str> for Box<MxcUri>
source§impl PartialEq<&str> for MxcUri
impl PartialEq<&str> for MxcUri
source§impl PartialEq<Box<MxcUri>> for &MxcUri
impl PartialEq<Box<MxcUri>> for &MxcUri
source§impl PartialEq<Box<MxcUri>> for MxcUri
impl PartialEq<Box<MxcUri>> for MxcUri
source§impl PartialEq<MxcUri> for &str
impl PartialEq<MxcUri> for &str
source§impl PartialEq<MxcUri> for Box<MxcUri>
impl PartialEq<MxcUri> for Box<MxcUri>
source§impl PartialEq<MxcUri> for OwnedMxcUri
impl PartialEq<MxcUri> for OwnedMxcUri
source§impl PartialEq<MxcUri> for String
impl PartialEq<MxcUri> for String
source§impl PartialEq<MxcUri> for str
impl PartialEq<MxcUri> for str
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 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<String> for Box<MxcUri>
impl PartialEq<String> for Box<MxcUri>
source§impl PartialEq<String> for MxcUri
impl PartialEq<String> for MxcUri
source§impl PartialEq for MxcUri
impl PartialEq for MxcUri
source§impl PartialOrd for MxcUri
impl PartialOrd for MxcUri
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 MxcUri
impl Serialize for MxcUri
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
source§impl ToOwned for MxcUri
impl ToOwned for MxcUri
§type Owned = OwnedMxcUri
type Owned = OwnedMxcUri
The resulting type after obtaining ownership.
source§fn to_owned(&self) -> <MxcUri as ToOwned>::Owned
fn to_owned(&self) -> <MxcUri as ToOwned>::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.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.