Struct ruma_common::SessionId
source · pub struct SessionId(/* private fields */);
Expand description
A session ID.
Session IDs in Matrix are opaque character sequences of [0-9a-zA-Z.=_-]
. Their length must
must not exceed 255 characters.
Implementations§
source§impl SessionId
impl SessionId
sourcepub fn parse(s: impl AsRef<str>) -> Result<OwnedSessionId, IdParseError>
pub fn parse(s: impl AsRef<str>) -> Result<OwnedSessionId, IdParseError>
Try parsing a &str
into an OwnedSessionId
.
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<SessionId>
.
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<SessionId> for OwnedSessionId
impl AsRef<SessionId> for OwnedSessionId
source§impl Borrow<SessionId> for OwnedSessionId
impl Borrow<SessionId> for OwnedSessionId
source§impl<'de> Deserialize<'de> for Box<SessionId>
impl<'de> Deserialize<'de> for Box<SessionId>
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 From<&SessionId> for OwnedSessionId
impl From<&SessionId> for OwnedSessionId
source§fn from(id: &SessionId) -> OwnedSessionId
fn from(id: &SessionId) -> OwnedSessionId
Converts to this type from the input type.
source§impl PartialEq<&SessionId> for OwnedSessionId
impl PartialEq<&SessionId> for OwnedSessionId
source§impl PartialEq<OwnedSessionId> for &SessionId
impl PartialEq<OwnedSessionId> for &SessionId
source§impl PartialEq<OwnedSessionId> for SessionId
impl PartialEq<OwnedSessionId> for SessionId
source§impl PartialEq<SessionId> for OwnedSessionId
impl PartialEq<SessionId> for OwnedSessionId
source§impl PartialOrd for SessionId
impl PartialOrd for SessionId
source§impl ToOwned for SessionId
impl ToOwned for SessionId
source§type Owned = OwnedSessionId
type Owned = OwnedSessionId
The resulting type after obtaining ownership.
source§fn 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 · 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 SessionId
impl StructuralPartialEq for SessionId
Auto Trait Implementations§
impl Freeze for SessionId
impl RefUnwindSafe for SessionId
impl Send for SessionId
impl !Sized for SessionId
impl Sync for SessionId
impl Unpin for SessionId
impl UnwindSafe for SessionId
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§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.