pub struct ClientSecret(/* private fields */);
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§
Source§impl ClientSecret
impl ClientSecret
Source§impl ClientSecret
impl ClientSecret
Sourcepub fn parse(s: impl AsRef<str>) -> Result<OwnedClientSecret, Error>
pub fn parse(s: impl AsRef<str>) -> Result<OwnedClientSecret, Error>
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<ClientSecret>, Error>
pub fn parse_box( s: impl AsRef<str> + Into<Box<str>>, ) -> Result<Box<ClientSecret>, 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.
Source§impl 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§
Source§impl AsRef<[u8]> for ClientSecret
impl AsRef<[u8]> for ClientSecret
Source§impl AsRef<ClientSecret> for ClientSecret
impl AsRef<ClientSecret> for ClientSecret
Source§fn as_ref(&self) -> &ClientSecret
fn as_ref(&self) -> &ClientSecret
Source§impl AsRef<ClientSecret> for OwnedClientSecret
impl AsRef<ClientSecret> for OwnedClientSecret
Source§fn as_ref(&self) -> &ClientSecret
fn as_ref(&self) -> &ClientSecret
Source§impl AsRef<str> for ClientSecret
impl AsRef<str> for ClientSecret
Source§impl Borrow<ClientSecret> for OwnedClientSecret
impl Borrow<ClientSecret> for OwnedClientSecret
Source§fn borrow(&self) -> &ClientSecret
fn borrow(&self) -> &ClientSecret
Source§impl Clone for Box<ClientSecret>
impl Clone for Box<ClientSecret>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ClientSecret
impl Debug for ClientSecret
Source§impl<'de> Deserialize<'de> for Box<ClientSecret>
impl<'de> Deserialize<'de> for Box<ClientSecret>
Source§fn deserialize<D>(
deserializer: D,
) -> Result<Box<ClientSecret>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Box<ClientSecret>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Source§impl Display for ClientSecret
impl Display for ClientSecret
Source§impl From<&ClientSecret> for Arc<ClientSecret>
impl From<&ClientSecret> for Arc<ClientSecret>
Source§fn from(s: &ClientSecret) -> Arc<ClientSecret>
fn from(s: &ClientSecret) -> Arc<ClientSecret>
Source§impl From<&ClientSecret> for Box<ClientSecret>
impl From<&ClientSecret> for Box<ClientSecret>
Source§fn from(id: &ClientSecret) -> Box<ClientSecret>
fn from(id: &ClientSecret) -> Box<ClientSecret>
Source§impl From<&ClientSecret> for OwnedClientSecret
impl From<&ClientSecret> for OwnedClientSecret
Source§fn from(id: &ClientSecret) -> OwnedClientSecret
fn from(id: &ClientSecret) -> OwnedClientSecret
Source§impl From<&ClientSecret> for Rc<ClientSecret>
impl From<&ClientSecret> for Rc<ClientSecret>
Source§fn from(s: &ClientSecret) -> Rc<ClientSecret>
fn from(s: &ClientSecret) -> Rc<ClientSecret>
Source§impl From<&ClientSecret> for String
impl From<&ClientSecret> for String
Source§fn from(id: &ClientSecret) -> String
fn from(id: &ClientSecret) -> String
Source§impl From<OwnedClientSecret> for Box<ClientSecret>
impl From<OwnedClientSecret> for Box<ClientSecret>
Source§fn from(a: OwnedClientSecret) -> Box<ClientSecret>
fn from(a: OwnedClientSecret) -> Box<ClientSecret>
Source§impl FromStr for Box<ClientSecret>
impl FromStr for Box<ClientSecret>
Source§impl Hash for ClientSecret
impl Hash for ClientSecret
Source§impl Ord for ClientSecret
impl Ord for ClientSecret
Source§impl PartialEq<&ClientSecret> for Box<ClientSecret>
impl PartialEq<&ClientSecret> for Box<ClientSecret>
Source§impl PartialEq<&ClientSecret> for OwnedClientSecret
impl PartialEq<&ClientSecret> for OwnedClientSecret
Source§impl PartialEq<&str> for ClientSecret
impl PartialEq<&str> for ClientSecret
Source§impl PartialEq<Box<ClientSecret>> for &ClientSecret
impl PartialEq<Box<ClientSecret>> for &ClientSecret
Source§impl PartialEq<Box<ClientSecret>> for ClientSecret
impl PartialEq<Box<ClientSecret>> for ClientSecret
Source§impl PartialEq<ClientSecret> for &str
impl PartialEq<ClientSecret> for &str
Source§impl PartialEq<ClientSecret> for Box<ClientSecret>
impl PartialEq<ClientSecret> for Box<ClientSecret>
Source§impl PartialEq<ClientSecret> for OwnedClientSecret
impl PartialEq<ClientSecret> for OwnedClientSecret
Source§impl PartialEq<ClientSecret> for String
impl PartialEq<ClientSecret> for String
Source§impl PartialEq<ClientSecret> for str
impl PartialEq<ClientSecret> for str
Source§impl PartialEq<OwnedClientSecret> for &ClientSecret
impl PartialEq<OwnedClientSecret> for &ClientSecret
Source§impl PartialEq<OwnedClientSecret> for Box<ClientSecret>
impl PartialEq<OwnedClientSecret> for Box<ClientSecret>
Source§impl PartialEq<OwnedClientSecret> for ClientSecret
impl PartialEq<OwnedClientSecret> for ClientSecret
Source§impl PartialEq<String> for ClientSecret
impl PartialEq<String> for ClientSecret
Source§impl PartialEq<str> for ClientSecret
impl PartialEq<str> for ClientSecret
Source§impl PartialEq for ClientSecret
impl PartialEq for ClientSecret
Source§impl PartialOrd for ClientSecret
impl PartialOrd for ClientSecret
Source§impl Serialize for ClientSecret
impl Serialize for ClientSecret
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Source§impl ToOwned for ClientSecret
impl ToOwned for ClientSecret
Source§type Owned = OwnedClientSecret
type Owned = OwnedClientSecret
Source§fn to_owned(&self) -> <ClientSecret as ToOwned>::Owned
fn to_owned(&self) -> <ClientSecret as ToOwned>::Owned
1.63.0 · Source§fn clone_into(&self, target: &mut Self::Owned)
fn clone_into(&self, target: &mut Self::Owned)
Source§impl<'a> TryFrom<&'a str> for &'a ClientSecret
impl<'a> TryFrom<&'a str> for &'a ClientSecret
impl Eq for ClientSecret
impl StructuralPartialEq for ClientSecret
Auto Trait Implementations§
impl Freeze for ClientSecret
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§
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
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
key
and return true
if they are equal.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
key
and return true
if they are equal.