Struct ruma_identifiers::ClientSecret
source · [−]#[repr(transparent)]pub struct ClientSecret(_);
Expand description
A client secret.
Client secrets in Matrix are opaque character sequences of [0-9a-zA-Z.=_-]
. Their length must
must not exceed 255 characters.
You can create one from a string (using ClientSecret::parse()
) but the recommended way is to
use ClientSecret::new()
to generate a random one. If that function is not available for you,
you need to activate this crate’s rand
Cargo feature.
Implementations
sourceimpl ClientSecret
impl ClientSecret
sourceimpl ClientSecret
impl ClientSecret
sourcepub fn parse(s: impl AsRef<str> + Into<Box<str>>) -> Result<Box<Self>, Error>
pub fn parse(s: impl AsRef<str> + Into<Box<str>>) -> Result<Box<Self>, Error>
Try parsing a &str
into a Box<ClientSecret>
.
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
sourceimpl AsRef<str> for ClientSecret
impl AsRef<str> for ClientSecret
sourceimpl Debug for ClientSecret
impl Debug for ClientSecret
sourceimpl Display for ClientSecret
impl Display for ClientSecret
sourceimpl From<&'_ ClientSecret> for Box<ClientSecret>
impl From<&'_ ClientSecret> for Box<ClientSecret>
sourcefn from(id: &ClientSecret) -> Self
fn from(id: &ClientSecret) -> Self
Converts to this type from the input type.
sourceimpl From<&'_ ClientSecret> for Rc<ClientSecret>
impl From<&'_ ClientSecret> for Rc<ClientSecret>
sourcefn from(s: &ClientSecret) -> Rc<ClientSecret>
fn from(s: &ClientSecret) -> Rc<ClientSecret>
Converts to this type from the input type.
sourceimpl From<&'_ ClientSecret> for Arc<ClientSecret>
impl From<&'_ ClientSecret> for Arc<ClientSecret>
sourcefn from(s: &ClientSecret) -> Arc<ClientSecret>
fn from(s: &ClientSecret) -> Arc<ClientSecret>
Converts to this type from the input type.
sourceimpl Hash for ClientSecret
impl Hash for ClientSecret
sourceimpl Ord for ClientSecret
impl Ord for ClientSecret
sourceimpl PartialEq<&'_ ClientSecret> for Box<ClientSecret>
impl PartialEq<&'_ ClientSecret> for Box<ClientSecret>
sourceimpl PartialEq<&'_ str> for ClientSecret
impl PartialEq<&'_ str> for ClientSecret
sourceimpl PartialEq<Box<ClientSecret, Global>> for ClientSecret
impl PartialEq<Box<ClientSecret, Global>> for ClientSecret
sourceimpl PartialEq<Box<ClientSecret, Global>> for &ClientSecret
impl PartialEq<Box<ClientSecret, Global>> for &ClientSecret
sourceimpl PartialEq<ClientSecret> for ClientSecret
impl PartialEq<ClientSecret> for ClientSecret
sourcefn eq(&self, other: &ClientSecret) -> bool
fn eq(&self, other: &ClientSecret) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ClientSecret) -> bool
fn ne(&self, other: &ClientSecret) -> bool
This method tests for !=
.
sourceimpl PartialEq<ClientSecret> for Box<ClientSecret>
impl PartialEq<ClientSecret> for Box<ClientSecret>
sourceimpl PartialEq<ClientSecret> for str
impl PartialEq<ClientSecret> for str
sourceimpl PartialEq<ClientSecret> for &str
impl PartialEq<ClientSecret> for &str
sourceimpl PartialEq<ClientSecret> for String
impl PartialEq<ClientSecret> for String
sourceimpl PartialEq<String> for ClientSecret
impl PartialEq<String> for ClientSecret
sourceimpl PartialEq<str> for ClientSecret
impl PartialEq<str> for ClientSecret
sourceimpl PartialOrd<ClientSecret> for ClientSecret
impl PartialOrd<ClientSecret> for ClientSecret
sourcefn partial_cmp(&self, other: &ClientSecret) -> Option<Ordering>
fn partial_cmp(&self, other: &ClientSecret) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl Serialize for ClientSecret
Available on crate feature serde
only.
impl Serialize for ClientSecret
serde
only.sourceimpl ToOwned for ClientSecret
impl ToOwned for ClientSecret
type Owned = Box<ClientSecret, Global>
type Owned = Box<ClientSecret, Global>
The resulting type after obtaining ownership.
sourcefn to_owned(&self) -> Self::Owned
fn to_owned(&self) -> Self::Owned
Creates owned data from borrowed data, usually by cloning. Read more
sourcefn clone_into(&self, target: &mut Self::Owned)
fn clone_into(&self, target: &mut Self::Owned)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more