pub struct SessionName(/* private fields */);Expand description
What a person calls one session: one address segment, and therefore one directory under a building.
A String here would put the segment rules in whichever caller
remembered them. This has one constructor, so a name that cannot be
a room cannot be spelled, on the wire or anywhere else.
Implementations§
Source§impl SessionName
impl SessionName
Sourcepub fn parse(raw: &str) -> Result<Self, AxError>
pub fn parse(raw: &str) -> Result<Self, AxError>
Sole constructor. Trims the ends - a person types a trailing space and means nothing by it - and then refuses anything that is not exactly one usable segment.
§Errors
E_INVALID_ARGS for empty input, a separator, a . or ..
segment, a protected metadata name, a control character, or a
name past [SESSION_NAME_MAX].
pub fn as_str(&self) -> &str
Trait Implementations§
Source§impl Clone for SessionName
impl Clone for SessionName
Source§impl Debug for SessionName
impl Debug for SessionName
Source§impl<'de> Deserialize<'de> for SessionName
impl<'de> Deserialize<'de> for SessionName
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for SessionName
impl Display for SessionName
impl Eq for SessionName
Source§impl Hash for SessionName
impl Hash for SessionName
Source§impl Ord for SessionName
impl Ord for SessionName
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for SessionName
impl PartialEq for SessionName
Source§impl PartialOrd for SessionName
impl PartialOrd for SessionName
Source§impl Serialize for SessionName
impl Serialize for SessionName
impl StructuralPartialEq for SessionName
Auto Trait Implementations§
impl Freeze for SessionName
impl RefUnwindSafe for SessionName
impl Send for SessionName
impl Sync for SessionName
impl Unpin for SessionName
impl UnsafeUnpin for SessionName
impl UnwindSafe for SessionName
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