pub struct RoomName(/* private fields */);
Expand description
The name of a room.
It can’t exceed 255 bytes or be empty.
Implementations§
Source§impl RoomName
impl RoomName
Sourcepub fn parse(s: impl AsRef<str>) -> Result<OwnedRoomName, Error>
pub fn parse(s: impl AsRef<str>) -> Result<OwnedRoomName, Error>
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<RoomName>, Error>
pub fn parse_box( s: impl AsRef<str> + Into<Box<str>>, ) -> Result<Box<RoomName>, Error>
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§
Source§impl AsRef<RoomName> for OwnedRoomName
impl AsRef<RoomName> for OwnedRoomName
Source§impl Borrow<RoomName> for OwnedRoomName
impl Borrow<RoomName> for OwnedRoomName
Source§impl<'de> Deserialize<'de> for Box<RoomName>
impl<'de> Deserialize<'de> for Box<RoomName>
Source§fn deserialize<D>(
deserializer: D,
) -> Result<Box<RoomName>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Box<RoomName>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&RoomName> for OwnedRoomName
impl From<&RoomName> for OwnedRoomName
Source§fn from(id: &RoomName) -> OwnedRoomName
fn from(id: &RoomName) -> OwnedRoomName
Converts to this type from the input type.
Source§impl PartialEq<&RoomName> for OwnedRoomName
impl PartialEq<&RoomName> for OwnedRoomName
Source§impl PartialEq<OwnedRoomName> for &RoomName
impl PartialEq<OwnedRoomName> for &RoomName
Source§impl PartialEq<OwnedRoomName> for RoomName
impl PartialEq<OwnedRoomName> for RoomName
Source§impl PartialEq<RoomName> for OwnedRoomName
impl PartialEq<RoomName> for OwnedRoomName
Source§impl PartialOrd for RoomName
impl PartialOrd for RoomName
Source§impl Serialize for RoomName
impl Serialize for RoomName
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 RoomName
impl ToOwned for RoomName
Source§type Owned = OwnedRoomName
type Owned = OwnedRoomName
The resulting type after obtaining ownership.
Source§fn to_owned(&self) -> <RoomName as ToOwned>::Owned
fn to_owned(&self) -> <RoomName 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 RoomName
impl StructuralPartialEq for RoomName
Auto Trait Implementations§
impl Freeze for RoomName
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§
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§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§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.