Struct RoomName

Source
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

Source

pub fn as_str(&self) -> &str

Creates a string slice from this RoomName.

Source

pub fn as_bytes(&self) -> &[u8]

Creates a byte slice from this RoomName.

Source§

impl RoomName

Source

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.

Source

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.

Source

pub fn parse_rc( s: impl AsRef<str> + Into<Rc<str>>, ) -> Result<Rc<RoomName>, Error>

Try parsing a &str into an Rc<RoomName>.

Source

pub fn parse_arc( s: impl AsRef<str> + Into<Arc<str>>, ) -> Result<Arc<RoomName>, Error>

Try parsing a &str into an Arc<RoomName>.

Trait Implementations§

Source§

impl AsRef<RoomName> for OwnedRoomName

Source§

fn as_ref(&self) -> &RoomName

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<str> for Box<RoomName>

Source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<str> for RoomName

Source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Borrow<RoomName> for OwnedRoomName

Source§

fn borrow(&self) -> &RoomName

Immutably borrows from an owned value. Read more
Source§

impl Clone for Box<RoomName>

Source§

fn clone(&self) -> Box<RoomName>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RoomName

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

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>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for RoomName

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl From<&RoomName> for Box<RoomName>

Source§

fn from(id: &RoomName) -> Box<RoomName>

Converts to this type from the input type.
Source§

impl From<&RoomName> for OwnedRoomName

Source§

fn from(id: &RoomName) -> OwnedRoomName

Converts to this type from the input type.
Source§

impl FromStr for Box<RoomName>

Source§

type Err = Error

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Box<RoomName>, <Box<RoomName> as FromStr>::Err>

Parses a string s to return a value of this type. Read more
Source§

impl Hash for RoomName

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
Source§

impl Ord for RoomName

Source§

fn cmp(&self, other: &RoomName) -> Ordering

This method returns an Ordering between self and other. Read more
Source§

impl PartialEq<&RoomName> for Box<RoomName>

Source§

fn eq(&self, other: &&RoomName) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<&RoomName> for OwnedRoomName

Source§

fn eq(&self, other: &&RoomName) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<&str> for Box<RoomName>

Source§

fn eq(&self, other: &&str) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<&str> for RoomName

Source§

fn eq(&self, other: &&str) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<Box<RoomName>> for &RoomName

Source§

fn eq(&self, other: &Box<RoomName>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<Box<RoomName>> for RoomName

Source§

fn eq(&self, other: &Box<RoomName>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<OwnedRoomName> for &RoomName

Source§

fn eq(&self, other: &OwnedRoomName) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<OwnedRoomName> for Box<RoomName>

Source§

fn eq(&self, other: &OwnedRoomName) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<OwnedRoomName> for RoomName

Source§

fn eq(&self, other: &OwnedRoomName) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<RoomName> for &str

Source§

fn eq(&self, other: &RoomName) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<RoomName> for Box<RoomName>

Source§

fn eq(&self, other: &RoomName) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<RoomName> for OwnedRoomName

Source§

fn eq(&self, other: &RoomName) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<RoomName> for str

Source§

fn eq(&self, other: &RoomName) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<String> for Box<RoomName>

Source§

fn eq(&self, other: &String) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<String> for RoomName

Source§

fn eq(&self, other: &String) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<str> for Box<RoomName>

Source§

fn eq(&self, other: &str) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<str> for RoomName

Source§

fn eq(&self, other: &str) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq for RoomName

Source§

fn eq(&self, other: &RoomName) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for RoomName

Source§

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 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Serialize for RoomName

Source§

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

Source§

type Owned = OwnedRoomName

The resulting type after obtaining ownership.
Source§

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)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<'a> TryFrom<&'a str> for &'a RoomName

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from( s: &'a str, ) -> Result<&'a RoomName, <&'a RoomName as TryFrom<&'a str>>::Error>

Performs the conversion.
Source§

impl TryFrom<&str> for Box<RoomName>

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from( s: &str, ) -> Result<Box<RoomName>, <Box<RoomName> as TryFrom<&str>>::Error>

Performs the conversion.
Source§

impl TryFrom<String> for Box<RoomName>

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from( s: String, ) -> Result<Box<RoomName>, <Box<RoomName> as TryFrom<String>>::Error>

Performs the conversion.
Source§

impl Eq for RoomName

Source§

impl StructuralPartialEq for RoomName

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

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
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more