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
Available on crate feature rand
only.
pub fn new() -> OwnedClientSecret
rand
only.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
sourceimpl AsRef<str> for Box<ClientSecret>
impl AsRef<str> for Box<ClientSecret>
sourceimpl AsRef<str> for ClientSecret
impl AsRef<str> for ClientSecret
sourceimpl Borrow<ClientSecret> for OwnedClientSecret
impl Borrow<ClientSecret> for OwnedClientSecret
sourcefn borrow(&self) -> &ClientSecret
fn borrow(&self) -> &ClientSecret
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>,
sourceimpl Display for ClientSecret
impl Display for ClientSecret
sourceimpl From<&ClientSecret> for Arc<ClientSecret>
impl From<&ClientSecret> for Arc<ClientSecret>
sourcefn from(s: &ClientSecret) -> Arc<ClientSecret>
fn from(s: &ClientSecret) -> Arc<ClientSecret>
sourceimpl From<&ClientSecret> for Box<ClientSecret>
impl From<&ClientSecret> for Box<ClientSecret>
sourcefn from(id: &ClientSecret) -> Self
fn from(id: &ClientSecret) -> Self
sourceimpl From<&ClientSecret> for OwnedClientSecret
impl From<&ClientSecret> for OwnedClientSecret
sourcefn from(id: &ClientSecret) -> OwnedClientSecret
fn from(id: &ClientSecret) -> OwnedClientSecret
sourceimpl From<&ClientSecret> for Rc<ClientSecret>
impl From<&ClientSecret> for Rc<ClientSecret>
sourcefn from(s: &ClientSecret) -> Rc<ClientSecret>
fn from(s: &ClientSecret) -> Rc<ClientSecret>
sourceimpl From<&ClientSecret> for String
impl From<&ClientSecret> for String
sourcefn from(id: &ClientSecret) -> Self
fn from(id: &ClientSecret) -> Self
sourceimpl From<OwnedClientSecret> for Box<ClientSecret>
impl From<OwnedClientSecret> for Box<ClientSecret>
sourcefn from(a: OwnedClientSecret) -> Box<ClientSecret>
fn from(a: OwnedClientSecret) -> Box<ClientSecret>
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 Box<ClientSecret>
impl PartialEq<&ClientSecret> for Box<ClientSecret>
sourcefn eq(&self, other: &&ClientSecret) -> bool
fn eq(&self, other: &&ClientSecret) -> bool
sourceimpl PartialEq<&ClientSecret> for OwnedClientSecret
impl PartialEq<&ClientSecret> for OwnedClientSecret
sourcefn eq(&self, other: &&ClientSecret) -> bool
fn eq(&self, other: &&ClientSecret) -> bool
sourceimpl PartialEq<Box<ClientSecret, Global>> for &ClientSecret
impl PartialEq<Box<ClientSecret, Global>> for &ClientSecret
sourcefn eq(&self, other: &Box<ClientSecret>) -> bool
fn eq(&self, other: &Box<ClientSecret>) -> bool
sourceimpl PartialEq<Box<ClientSecret, Global>> for ClientSecret
impl PartialEq<Box<ClientSecret, Global>> for ClientSecret
sourcefn eq(&self, other: &Box<ClientSecret>) -> bool
fn eq(&self, other: &Box<ClientSecret>) -> bool
sourceimpl PartialEq<ClientSecret> for &str
impl PartialEq<ClientSecret> for &str
sourcefn eq(&self, other: &ClientSecret) -> bool
fn eq(&self, other: &ClientSecret) -> bool
sourceimpl PartialEq<ClientSecret> for Box<ClientSecret>
impl PartialEq<ClientSecret> for Box<ClientSecret>
sourcefn eq(&self, other: &ClientSecret) -> bool
fn eq(&self, other: &ClientSecret) -> bool
sourceimpl PartialEq<ClientSecret> for ClientSecret
impl PartialEq<ClientSecret> for ClientSecret
sourcefn eq(&self, other: &ClientSecret) -> bool
fn eq(&self, other: &ClientSecret) -> bool
sourceimpl PartialEq<ClientSecret> for OwnedClientSecret
impl PartialEq<ClientSecret> for OwnedClientSecret
sourcefn eq(&self, other: &ClientSecret) -> bool
fn eq(&self, other: &ClientSecret) -> bool
sourceimpl PartialEq<ClientSecret> for String
impl PartialEq<ClientSecret> for String
sourcefn eq(&self, other: &ClientSecret) -> bool
fn eq(&self, other: &ClientSecret) -> bool
sourceimpl PartialEq<ClientSecret> for str
impl PartialEq<ClientSecret> for str
sourcefn eq(&self, other: &ClientSecret) -> bool
fn eq(&self, other: &ClientSecret) -> bool
sourceimpl PartialEq<OwnedClientSecret> for &ClientSecret
impl PartialEq<OwnedClientSecret> for &ClientSecret
sourcefn eq(&self, other: &OwnedClientSecret) -> bool
fn eq(&self, other: &OwnedClientSecret) -> bool
sourceimpl PartialEq<OwnedClientSecret> for Box<ClientSecret>
impl PartialEq<OwnedClientSecret> for Box<ClientSecret>
sourcefn eq(&self, other: &OwnedClientSecret) -> bool
fn eq(&self, other: &OwnedClientSecret) -> bool
sourceimpl PartialEq<OwnedClientSecret> for ClientSecret
impl PartialEq<OwnedClientSecret> for ClientSecret
sourcefn eq(&self, other: &OwnedClientSecret) -> bool
fn eq(&self, other: &OwnedClientSecret) -> bool
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>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
const fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresourceimpl Serialize for ClientSecret
impl Serialize for ClientSecret
sourceimpl ToOwned for ClientSecret
impl ToOwned for ClientSecret
type Owned = OwnedClientSecret
type Owned = OwnedClientSecret
sourcefn to_owned(&self) -> Self::Owned
fn to_owned(&self) -> Self::Owned
1.63.0 · sourcefn clone_into(&self, target: &mut Self::Owned)
fn clone_into(&self, target: &mut Self::Owned)
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 Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.