Struct matrix_sdk_base::ruma::ClientSecret
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§
§impl ClientSecret
impl ClientSecret
§impl ClientSecret
impl ClientSecret
pub 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.
pub 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.
§impl ClientSecret
impl ClientSecret
pub 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§
§impl AsRef<[u8]> for ClientSecret
impl AsRef<[u8]> for ClientSecret
§impl AsRef<ClientSecret> for ClientSecret
impl AsRef<ClientSecret> for ClientSecret
§fn as_ref(&self) -> &ClientSecret
fn as_ref(&self) -> &ClientSecret
§impl AsRef<ClientSecret> for OwnedClientSecret
impl AsRef<ClientSecret> for OwnedClientSecret
§fn as_ref(&self) -> &ClientSecret
fn as_ref(&self) -> &ClientSecret
§impl AsRef<str> for ClientSecret
impl AsRef<str> for ClientSecret
§impl Borrow<ClientSecret> for OwnedClientSecret
impl Borrow<ClientSecret> for OwnedClientSecret
§fn borrow(&self) -> &ClientSecret
fn borrow(&self) -> &ClientSecret
§impl Clone for Box<ClientSecret>
impl Clone for Box<ClientSecret>
§fn clone(&self) -> Box<ClientSecret>
fn clone(&self) -> Box<ClientSecret>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for ClientSecret
impl Debug for ClientSecret
§impl<'de> Deserialize<'de> for Box<ClientSecret>
impl<'de> Deserialize<'de> for Box<ClientSecret>
§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>,
§impl Display for ClientSecret
impl Display for ClientSecret
§impl From<&ClientSecret> for Arc<ClientSecret>
impl From<&ClientSecret> for Arc<ClientSecret>
§fn from(s: &ClientSecret) -> Arc<ClientSecret>
fn from(s: &ClientSecret) -> Arc<ClientSecret>
§impl From<&ClientSecret> for Box<ClientSecret>
impl From<&ClientSecret> for Box<ClientSecret>
§fn from(id: &ClientSecret) -> Box<ClientSecret>
fn from(id: &ClientSecret) -> Box<ClientSecret>
§impl From<&ClientSecret> for OwnedClientSecret
impl From<&ClientSecret> for OwnedClientSecret
§fn from(id: &ClientSecret) -> OwnedClientSecret
fn from(id: &ClientSecret) -> OwnedClientSecret
§impl From<&ClientSecret> for Rc<ClientSecret>
impl From<&ClientSecret> for Rc<ClientSecret>
§fn from(s: &ClientSecret) -> Rc<ClientSecret>
fn from(s: &ClientSecret) -> Rc<ClientSecret>
§impl From<&ClientSecret> for String
impl From<&ClientSecret> for String
§fn from(id: &ClientSecret) -> String
fn from(id: &ClientSecret) -> String
§impl From<OwnedClientSecret> for Box<ClientSecret>
impl From<OwnedClientSecret> for Box<ClientSecret>
§fn from(a: OwnedClientSecret) -> Box<ClientSecret>
fn from(a: OwnedClientSecret) -> Box<ClientSecret>
§impl Hash for ClientSecret
impl Hash for ClientSecret
§impl Ord for ClientSecret
impl Ord for ClientSecret
§impl PartialEq<&ClientSecret> for OwnedClientSecret
impl PartialEq<&ClientSecret> for OwnedClientSecret
§fn eq(&self, other: &&ClientSecret) -> bool
fn eq(&self, other: &&ClientSecret) -> bool
self
and other
values to be equal, and is used
by ==
.§impl PartialEq<&str> for ClientSecret
impl PartialEq<&str> for ClientSecret
§impl PartialEq<Box<ClientSecret>> for &ClientSecret
impl PartialEq<Box<ClientSecret>> for &ClientSecret
§fn eq(&self, other: &Box<ClientSecret>) -> bool
fn eq(&self, other: &Box<ClientSecret>) -> bool
self
and other
values to be equal, and is used
by ==
.§impl PartialEq<Box<ClientSecret>> for ClientSecret
impl PartialEq<Box<ClientSecret>> for ClientSecret
§fn eq(&self, other: &Box<ClientSecret>) -> bool
fn eq(&self, other: &Box<ClientSecret>) -> bool
self
and other
values to be equal, and is used
by ==
.§impl PartialEq<ClientSecret> for &str
impl PartialEq<ClientSecret> for &str
§fn eq(&self, other: &ClientSecret) -> bool
fn eq(&self, other: &ClientSecret) -> bool
self
and other
values to be equal, and is used
by ==
.§impl PartialEq<ClientSecret> for OwnedClientSecret
impl PartialEq<ClientSecret> for OwnedClientSecret
§fn eq(&self, other: &ClientSecret) -> bool
fn eq(&self, other: &ClientSecret) -> bool
self
and other
values to be equal, and is used
by ==
.§impl PartialEq<ClientSecret> for String
impl PartialEq<ClientSecret> for String
§fn eq(&self, other: &ClientSecret) -> bool
fn eq(&self, other: &ClientSecret) -> bool
self
and other
values to be equal, and is used
by ==
.§impl PartialEq<ClientSecret> for str
impl PartialEq<ClientSecret> for str
§fn eq(&self, other: &ClientSecret) -> bool
fn eq(&self, other: &ClientSecret) -> bool
self
and other
values to be equal, and is used
by ==
.§impl PartialEq<OwnedClientSecret> for &ClientSecret
impl PartialEq<OwnedClientSecret> for &ClientSecret
§fn eq(&self, other: &OwnedClientSecret) -> bool
fn eq(&self, other: &OwnedClientSecret) -> bool
self
and other
values to be equal, and is used
by ==
.§impl PartialEq<OwnedClientSecret> for ClientSecret
impl PartialEq<OwnedClientSecret> for ClientSecret
§fn eq(&self, other: &OwnedClientSecret) -> bool
fn eq(&self, other: &OwnedClientSecret) -> bool
self
and other
values to be equal, and is used
by ==
.§impl PartialEq<String> for ClientSecret
impl PartialEq<String> for ClientSecret
§impl PartialEq<str> for ClientSecret
impl PartialEq<str> for ClientSecret
§impl PartialEq for ClientSecret
impl PartialEq for ClientSecret
§fn eq(&self, other: &ClientSecret) -> bool
fn eq(&self, other: &ClientSecret) -> bool
self
and other
values to be equal, and is used
by ==
.§impl PartialOrd for ClientSecret
impl PartialOrd for ClientSecret
§fn partial_cmp(&self, other: &ClientSecret) -> Option<Ordering>
fn partial_cmp(&self, other: &ClientSecret) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more§impl Serialize for ClientSecret
impl Serialize for ClientSecret
§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,
§impl ToOwned for ClientSecret
impl ToOwned for ClientSecret
§type Owned = OwnedClientSecret
type Owned = OwnedClientSecret
§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)
§impl<'a> TryFrom<&'a str> for &'a ClientSecret
impl<'a> TryFrom<&'a str> for &'a ClientSecret
§impl TryFrom<&str> for Box<ClientSecret>
impl TryFrom<&str> for Box<ClientSecret>
§impl 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§
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
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.