pub struct RoomName(/* private fields */);Expand description
A validated room name.
Guaranteed not to exceed MAX_ROOM_STRING_BYTES bytes (UTF-8).
The limit is enforced at construction time via RoomName::new and at
Serde decode time, so a value held in this type can never produce a payload
that exceeds MAX_SAFE_PAYLOAD_SIZE.
Implementations§
Source§impl RoomName
impl RoomName
Sourcepub fn new(s: impl Into<String>) -> Result<Self, RoomStringError>
pub fn new(s: impl Into<String>) -> Result<Self, RoomStringError>
Creates a RoomName, returning RoomStringError if s exceeds
MAX_ROOM_STRING_BYTES bytes.
§Errors
Returns RoomStringError if the byte length of s exceeds
MAX_ROOM_STRING_BYTES.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RoomName
impl<'de> Deserialize<'de> for RoomName
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 Ord for RoomName
impl Ord for RoomName
Source§impl PartialOrd for RoomName
impl PartialOrd for RoomName
impl Eq for RoomName
impl StructuralPartialEq for RoomName
Auto Trait Implementations§
impl Freeze for RoomName
impl RefUnwindSafe for RoomName
impl Send for RoomName
impl Sync for RoomName
impl Unpin for RoomName
impl UnsafeUnpin 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