Struct ruma_common::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>) -> Result<OwnedClientSecret, IdParseError>
pub fn parse(s: impl AsRef<str>) -> Result<OwnedClientSecret, IdParseError>
Try parsing a &str
into an OwnedClientSecret
.
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<ClientSecret>
.
The same can also be done using FromStr
, TryFrom
or TryInto
.
This function is simply more constrained and thus useful in generic contexts.
sourceimpl ClientSecret
impl ClientSecret
sourcepub fn new() -> OwnedClientSecret
pub fn new() -> OwnedClientSecret
Creates a random client secret.
This will currently be a UUID without hyphens, but no guarantees are made about the structure of client secrets generated from this function.
Trait Implementations
sourceimpl AsRef<ClientSecret> for OwnedClientSecret
impl AsRef<ClientSecret> for OwnedClientSecret
sourcefn as_ref(&self) -> &ClientSecret
fn as_ref(&self) -> &ClientSecret
Converts this type into a shared reference of the (usually inferred) input type.
sourceimpl AsRef<str> for ClientSecret
impl AsRef<str> for ClientSecret
sourceimpl AsRef<str> for Box<ClientSecret>
impl AsRef<str> for Box<ClientSecret>
sourceimpl Borrow<ClientSecret> for OwnedClientSecret
impl Borrow<ClientSecret> for OwnedClientSecret
sourcefn borrow(&self) -> &ClientSecret
fn borrow(&self) -> &ClientSecret
Immutably borrows from an owned value. Read more
sourceimpl Clone for Box<ClientSecret>
impl Clone for Box<ClientSecret>
sourceimpl Debug for ClientSecret
impl Debug for ClientSecret
sourceimpl<'de> Deserialize<'de> for Box<ClientSecret>
impl<'de> Deserialize<'de> for Box<ClientSecret>
sourcefn 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
sourceimpl Display for ClientSecret
impl Display for ClientSecret
sourceimpl From<&ClientSecret> for OwnedClientSecret
impl From<&ClientSecret> for OwnedClientSecret
sourcefn from(id: &ClientSecret) -> OwnedClientSecret
fn from(id: &ClientSecret) -> OwnedClientSecret
Converts to this type from the input type.
sourceimpl From<&ClientSecret> for String
impl From<&ClientSecret> for String
sourcefn from(id: &ClientSecret) -> Self
fn from(id: &ClientSecret) -> Self
Converts to this type from the input type.
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 FromStr for Box<ClientSecret>
impl FromStr for Box<ClientSecret>
sourceimpl Hash for ClientSecret
impl Hash for ClientSecret
sourceimpl Ord for ClientSecret
impl Ord for ClientSecret
sourceimpl PartialEq<&ClientSecret> for OwnedClientSecret
impl PartialEq<&ClientSecret> for OwnedClientSecret
sourceimpl PartialEq<&ClientSecret> for Box<ClientSecret>
impl PartialEq<&ClientSecret> for Box<ClientSecret>
sourceimpl PartialEq<&str> for ClientSecret
impl PartialEq<&str> for ClientSecret
sourceimpl PartialEq<&str> for Box<ClientSecret>
impl PartialEq<&str> for Box<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 OwnedClientSecret
impl PartialEq<ClientSecret> for OwnedClientSecret
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<OwnedClientSecret> for ClientSecret
impl PartialEq<OwnedClientSecret> for ClientSecret
sourceimpl PartialEq<OwnedClientSecret> for &ClientSecret
impl PartialEq<OwnedClientSecret> for &ClientSecret
sourceimpl PartialEq<OwnedClientSecret> for Box<ClientSecret>
impl PartialEq<OwnedClientSecret> for Box<ClientSecret>
sourceimpl PartialEq<String> for ClientSecret
impl PartialEq<String> for ClientSecret
sourceimpl PartialEq<String> for Box<ClientSecret>
impl PartialEq<String> for Box<ClientSecret>
sourceimpl PartialEq<str> for ClientSecret
impl PartialEq<str> for ClientSecret
sourceimpl PartialEq<str> for Box<ClientSecret>
impl PartialEq<str> for Box<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
impl Serialize for ClientSecret
sourceimpl ToOwned for ClientSecret
impl ToOwned for ClientSecret
type Owned = OwnedClientSecret
type Owned = OwnedClientSecret
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
1.63.0 · sourcefn 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
sourceimpl<'a> TryFrom<&'a str> for &'a ClientSecret
impl<'a> TryFrom<&'a str> for &'a ClientSecret
sourceimpl TryFrom<&str> for Box<ClientSecret>
impl TryFrom<&str> for Box<ClientSecret>
sourceimpl TryFrom<String> for Box<ClientSecret>
impl TryFrom<String> for Box<ClientSecret>
impl Eq for ClientSecret
impl StructuralEq for ClientSecret
impl StructuralPartialEq for ClientSecret
Auto Trait Implementations
impl RefUnwindSafe for ClientSecret
impl Send for ClientSecret
impl !Sized for ClientSecret
impl Sync for ClientSecret
impl Unpin for ClientSecret
impl UnwindSafe for ClientSecret
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> CallHasher for T where
T: Hash + ?Sized,
impl<T> CallHasher for T where
T: Hash + ?Sized,
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.