Struct matrix_sdk_base::ruma::Base64PublicKey
source · pub struct Base64PublicKey(/* private fields */);
Expand description
A public key encoded using unpadded base64, used as an identifier for cross-signing keys.
This string is validated using the set [a-zA-Z0-9+/=]
, but it is not validated to be decodable
as base64. This type is provided simply for its semantic value.
Implementations§
source§impl Base64PublicKey
impl Base64PublicKey
sourcepub fn parse(s: impl AsRef<str>) -> Result<OwnedBase64PublicKey, Error>
pub fn parse(s: impl AsRef<str>) -> Result<OwnedBase64PublicKey, Error>
Try parsing a &str
into an OwnedBase64PublicKey
.
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<Base64PublicKey>, Error>
pub fn parse_box( s: impl AsRef<str> + Into<Box<str>>, ) -> Result<Box<Base64PublicKey>, Error>
Try parsing a &str
into a Box<Base64PublicKey>
.
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§
source§impl AsRef<[u8]> for Base64PublicKey
impl AsRef<[u8]> for Base64PublicKey
source§impl AsRef<Base64PublicKey> for Base64PublicKey
impl AsRef<Base64PublicKey> for Base64PublicKey
source§fn as_ref(&self) -> &Base64PublicKey
fn as_ref(&self) -> &Base64PublicKey
Converts this type into a shared reference of the (usually inferred) input type.
source§impl AsRef<Base64PublicKey> for OwnedBase64PublicKey
impl AsRef<Base64PublicKey> for OwnedBase64PublicKey
source§fn as_ref(&self) -> &Base64PublicKey
fn as_ref(&self) -> &Base64PublicKey
Converts this type into a shared reference of the (usually inferred) input type.
source§impl AsRef<str> for Base64PublicKey
impl AsRef<str> for Base64PublicKey
source§impl Borrow<Base64PublicKey> for OwnedBase64PublicKey
impl Borrow<Base64PublicKey> for OwnedBase64PublicKey
source§fn borrow(&self) -> &Base64PublicKey
fn borrow(&self) -> &Base64PublicKey
Immutably borrows from an owned value. Read more
source§impl Clone for Box<Base64PublicKey>
impl Clone for Box<Base64PublicKey>
source§impl Debug for Base64PublicKey
impl Debug for Base64PublicKey
source§impl<'de> Deserialize<'de> for Box<Base64PublicKey>
impl<'de> Deserialize<'de> for Box<Base64PublicKey>
source§fn deserialize<D>(
deserializer: D,
) -> Result<Box<Base64PublicKey>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Box<Base64PublicKey>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for Base64PublicKey
impl Display for Base64PublicKey
source§impl<'a> From<&'a Base64PublicKey> for &'a Base64PublicKeyOrDeviceId
impl<'a> From<&'a Base64PublicKey> for &'a Base64PublicKeyOrDeviceId
source§fn from(value: &'a Base64PublicKey) -> &'a Base64PublicKeyOrDeviceId
fn from(value: &'a Base64PublicKey) -> &'a Base64PublicKeyOrDeviceId
Converts to this type from the input type.
source§impl From<&Base64PublicKey> for Arc<Base64PublicKey>
impl From<&Base64PublicKey> for Arc<Base64PublicKey>
source§fn from(s: &Base64PublicKey) -> Arc<Base64PublicKey>
fn from(s: &Base64PublicKey) -> Arc<Base64PublicKey>
Converts to this type from the input type.
source§impl From<&Base64PublicKey> for Box<Base64PublicKey>
impl From<&Base64PublicKey> for Box<Base64PublicKey>
source§fn from(id: &Base64PublicKey) -> Box<Base64PublicKey>
fn from(id: &Base64PublicKey) -> Box<Base64PublicKey>
Converts to this type from the input type.
source§impl From<&Base64PublicKey> for OwnedBase64PublicKey
impl From<&Base64PublicKey> for OwnedBase64PublicKey
source§fn from(id: &Base64PublicKey) -> OwnedBase64PublicKey
fn from(id: &Base64PublicKey) -> OwnedBase64PublicKey
Converts to this type from the input type.
source§impl From<&Base64PublicKey> for Rc<Base64PublicKey>
impl From<&Base64PublicKey> for Rc<Base64PublicKey>
source§fn from(s: &Base64PublicKey) -> Rc<Base64PublicKey>
fn from(s: &Base64PublicKey) -> Rc<Base64PublicKey>
Converts to this type from the input type.
source§impl From<&Base64PublicKey> for String
impl From<&Base64PublicKey> for String
source§fn from(id: &Base64PublicKey) -> String
fn from(id: &Base64PublicKey) -> String
Converts to this type from the input type.
source§impl From<OwnedBase64PublicKey> for Box<Base64PublicKey>
impl From<OwnedBase64PublicKey> for Box<Base64PublicKey>
source§fn from(a: OwnedBase64PublicKey) -> Box<Base64PublicKey>
fn from(a: OwnedBase64PublicKey) -> Box<Base64PublicKey>
Converts to this type from the input type.
source§impl Hash for Base64PublicKey
impl Hash for Base64PublicKey
source§impl KeyName for Base64PublicKey
impl KeyName for Base64PublicKey
source§impl Ord for Base64PublicKey
impl Ord for Base64PublicKey
source§impl PartialEq<&Base64PublicKey> for OwnedBase64PublicKey
impl PartialEq<&Base64PublicKey> for OwnedBase64PublicKey
source§fn eq(&self, other: &&Base64PublicKey) -> bool
fn eq(&self, other: &&Base64PublicKey) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<&str> for Base64PublicKey
impl PartialEq<&str> for Base64PublicKey
source§impl PartialEq<Base64PublicKey> for &str
impl PartialEq<Base64PublicKey> for &str
source§fn eq(&self, other: &Base64PublicKey) -> bool
fn eq(&self, other: &Base64PublicKey) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<Base64PublicKey> for OwnedBase64PublicKey
impl PartialEq<Base64PublicKey> for OwnedBase64PublicKey
source§fn eq(&self, other: &Base64PublicKey) -> bool
fn eq(&self, other: &Base64PublicKey) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<Base64PublicKey> for String
impl PartialEq<Base64PublicKey> for String
source§fn eq(&self, other: &Base64PublicKey) -> bool
fn eq(&self, other: &Base64PublicKey) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<Base64PublicKey> for str
impl PartialEq<Base64PublicKey> for str
source§fn eq(&self, other: &Base64PublicKey) -> bool
fn eq(&self, other: &Base64PublicKey) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<Box<Base64PublicKey>> for &Base64PublicKey
impl PartialEq<Box<Base64PublicKey>> for &Base64PublicKey
source§impl PartialEq<Box<Base64PublicKey>> for Base64PublicKey
impl PartialEq<Box<Base64PublicKey>> for Base64PublicKey
source§impl PartialEq<OwnedBase64PublicKey> for &Base64PublicKey
impl PartialEq<OwnedBase64PublicKey> for &Base64PublicKey
source§fn eq(&self, other: &OwnedBase64PublicKey) -> bool
fn eq(&self, other: &OwnedBase64PublicKey) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<OwnedBase64PublicKey> for Base64PublicKey
impl PartialEq<OwnedBase64PublicKey> for Base64PublicKey
source§fn eq(&self, other: &OwnedBase64PublicKey) -> bool
fn eq(&self, other: &OwnedBase64PublicKey) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<String> for Base64PublicKey
impl PartialEq<String> for Base64PublicKey
source§impl PartialEq<str> for Base64PublicKey
impl PartialEq<str> for Base64PublicKey
source§impl PartialEq for Base64PublicKey
impl PartialEq for Base64PublicKey
source§fn eq(&self, other: &Base64PublicKey) -> bool
fn eq(&self, other: &Base64PublicKey) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for Base64PublicKey
impl PartialOrd for Base64PublicKey
source§fn partial_cmp(&self, other: &Base64PublicKey) -> Option<Ordering>
fn partial_cmp(&self, other: &Base64PublicKey) -> Option<Ordering>
1.0.0 · source§fn 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 moresource§impl Serialize for Base64PublicKey
impl Serialize for Base64PublicKey
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,
Serialize this value into the given Serde serializer. Read more
source§impl ToOwned for Base64PublicKey
impl ToOwned for Base64PublicKey
§type Owned = OwnedBase64PublicKey
type Owned = OwnedBase64PublicKey
The resulting type after obtaining ownership.
source§fn to_owned(&self) -> <Base64PublicKey as ToOwned>::Owned
fn to_owned(&self) -> <Base64PublicKey as ToOwned>::Owned
Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · source§fn 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
source§impl TryFrom<&Base64PublicKey> for Base64
impl TryFrom<&Base64PublicKey> for Base64
§type Error = Base64DecodeError
type Error = Base64DecodeError
The type returned in the event of a conversion error.
source§fn try_from(
value: &Base64PublicKey,
) -> Result<Base64, <Base64 as TryFrom<&Base64PublicKey>>::Error>
fn try_from( value: &Base64PublicKey, ) -> Result<Base64, <Base64 as TryFrom<&Base64PublicKey>>::Error>
Performs the conversion.
source§impl<'a> TryFrom<&'a str> for &'a Base64PublicKey
impl<'a> TryFrom<&'a str> for &'a Base64PublicKey
impl Eq for Base64PublicKey
impl StructuralPartialEq for Base64PublicKey
Auto Trait Implementations§
impl Freeze for Base64PublicKey
impl RefUnwindSafe for Base64PublicKey
impl Send for Base64PublicKey
impl !Sized for Base64PublicKey
impl Sync for Base64PublicKey
impl Unpin for Base64PublicKey
impl UnwindSafe for Base64PublicKey
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
Mutably borrows from an owned value. Read more
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
Compare self to
key
and return true
if they are equal.