Struct ruma_common::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, IdParseError>
pub fn parse(s: impl AsRef<str>) -> Result<OwnedBase64PublicKey, IdParseError>
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<Self>, IdParseError>
pub fn parse_box( s: impl AsRef<str> + Into<Box<str>>, ) -> Result<Box<Self>, IdParseError>
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<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
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) -> Self
fn from(value: &'a Base64PublicKey) -> Self
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) -> Self
fn from(id: &Base64PublicKey) -> Self
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) -> Self
fn from(id: &Base64PublicKey) -> Self
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 FromStr for Box<Base64PublicKey>
impl FromStr for Box<Base64PublicKey>
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 Box<Base64PublicKey>
impl PartialEq<&Base64PublicKey> for Box<Base64PublicKey>
source§impl PartialEq<&Base64PublicKey> for OwnedBase64PublicKey
impl PartialEq<&Base64PublicKey> for OwnedBase64PublicKey
source§impl PartialEq<&str> for Base64PublicKey
impl PartialEq<&str> for Base64PublicKey
source§impl PartialEq<Base64PublicKey> for &str
impl PartialEq<Base64PublicKey> for &str
source§impl PartialEq<Base64PublicKey> for Box<Base64PublicKey>
impl PartialEq<Base64PublicKey> for Box<Base64PublicKey>
source§impl PartialEq<Base64PublicKey> for String
impl PartialEq<Base64PublicKey> for String
source§impl PartialEq<Base64PublicKey> for str
impl PartialEq<Base64PublicKey> for str
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§impl PartialEq<OwnedBase64PublicKey> for Box<Base64PublicKey>
impl PartialEq<OwnedBase64PublicKey> for Box<Base64PublicKey>
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§impl PartialOrd for Base64PublicKey
impl PartialOrd for Base64PublicKey
source§impl Serialize for Base64PublicKey
impl Serialize for Base64PublicKey
source§impl ToOwned for Base64PublicKey
impl ToOwned for Base64PublicKey
source§type Owned = OwnedBase64PublicKey
type Owned = OwnedBase64PublicKey
The resulting type after obtaining ownership.
source§fn 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 · 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<Standard, Vec<u8>>
impl TryFrom<&Base64PublicKey> for Base64<Standard, Vec<u8>>
source§type Error = Base64DecodeError
type Error = Base64DecodeError
The type returned in the event of a conversion error.
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.