Struct ruma_common::RoomName
source · [−]#[repr(transparent)]pub struct RoomName(_);
Expand description
The name of a room.
It can’t exceed 255 bytes or be empty.
Implementations
sourceimpl RoomName
impl RoomName
sourcepub fn parse(s: impl AsRef<str>) -> Result<OwnedRoomName, IdParseError>
pub fn parse(s: impl AsRef<str>) -> Result<OwnedRoomName, IdParseError>
Try parsing a &str
into an OwnedRoomName
.
The same can also be done using FromStr
, TryFrom
or TryInto
.
This function is simply more constrained and thus useful in generic contexts.
sourcepub fn parse_box(
s: impl AsRef<str> + Into<Box<str>>
) -> Result<Box<Self>, IdParseError>
pub fn parse_box(
s: impl AsRef<str> + Into<Box<str>>
) -> Result<Box<Self>, IdParseError>
Try parsing a &str
into a Box<RoomName>
.
The same can also be done using FromStr
, TryFrom
or TryInto
.
This function is simply more constrained and thus useful in generic contexts.
Trait Implementations
sourceimpl AsRef<RoomName> for OwnedRoomName
impl AsRef<RoomName> for OwnedRoomName
sourceimpl Borrow<RoomName> for OwnedRoomName
impl Borrow<RoomName> for OwnedRoomName
sourceimpl<'de> Deserialize<'de> for Box<RoomName>
impl<'de> Deserialize<'de> for Box<RoomName>
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 From<&RoomName> for OwnedRoomName
impl From<&RoomName> for OwnedRoomName
sourcefn from(id: &RoomName) -> OwnedRoomName
fn from(id: &RoomName) -> OwnedRoomName
Converts to this type from the input type.
sourceimpl Ord for RoomName
impl Ord for RoomName
sourceimpl PartialEq<&RoomName> for OwnedRoomName
impl PartialEq<&RoomName> for OwnedRoomName
sourceimpl PartialEq<OwnedRoomName> for RoomName
impl PartialEq<OwnedRoomName> for RoomName
sourceimpl PartialEq<OwnedRoomName> for &RoomName
impl PartialEq<OwnedRoomName> for &RoomName
sourceimpl PartialEq<OwnedRoomName> for Box<RoomName>
impl PartialEq<OwnedRoomName> for Box<RoomName>
sourceimpl PartialEq<RoomName> for OwnedRoomName
impl PartialEq<RoomName> for OwnedRoomName
sourceimpl PartialOrd<RoomName> for RoomName
impl PartialOrd<RoomName> for RoomName
sourcefn partial_cmp(&self, other: &RoomName) -> Option<Ordering>
fn partial_cmp(&self, other: &RoomName) -> 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 ToOwned for RoomName
impl ToOwned for RoomName
type Owned = OwnedRoomName
type Owned = OwnedRoomName
The resulting type after obtaining ownership.
sourcefn 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 · sourcefn 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 RoomName
impl StructuralEq for RoomName
impl StructuralPartialEq for RoomName
Auto Trait Implementations
impl RefUnwindSafe for RoomName
impl Send for RoomName
impl !Sized for RoomName
impl Sync for RoomName
impl Unpin for RoomName
impl UnwindSafe for RoomName
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.