Struct ruma_common::MxcUri
source · #[repr(transparent)]pub struct MxcUri(_);
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 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, Global>> for &MxcUri
impl PartialEq<Box<MxcUri, Global>> for &MxcUri
source§impl PartialEq<Box<MxcUri, Global>> for MxcUri
impl PartialEq<Box<MxcUri, Global>> 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 MxcUri
impl PartialEq<MxcUri> for 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 PartialOrd<MxcUri> for MxcUri
impl PartialOrd<MxcUri> 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 ToOwned for MxcUri
impl ToOwned for MxcUri
§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