Struct core::identifier::KeyIdentifier
[−]pub struct KeyIdentifier {
pub public_key: Vec<u8, Global>,
pub derivator: KeyDerivator,
}
Expand description
Key based identifier
Fields
public_key: Vec<u8, Global>
derivator: KeyDerivator
Implementations
impl KeyIdentifier
impl KeyIdentifier
KeyIdentifier implementation
pub fn new(derivator: KeyDerivator, pk: &[u8]) -> KeyIdentifier
pub fn to_signature_derivator(&self) -> SignatureDerivator
pub fn verify(
&self,
data: &[u8],
signature: SignatureIdentifier
) -> Result<(), Error>
Trait Implementations
impl BorshDeserialize for KeyIdentifierwhere
Vec<u8, Global>: BorshDeserialize,
KeyDerivator: BorshDeserialize,
impl BorshDeserialize for KeyIdentifierwhere
Vec<u8, Global>: BorshDeserialize,
KeyDerivator: BorshDeserialize,
fn deserialize(buf: &mut &[u8]) -> Result<KeyIdentifier, Error>
fn deserialize(buf: &mut &[u8]) -> Result<KeyIdentifier, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes. Read more
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
impl BorshSerialize for KeyIdentifierwhere
Vec<u8, Global>: BorshSerialize,
KeyDerivator: BorshSerialize,
impl BorshSerialize for KeyIdentifierwhere
Vec<u8, Global>: BorshSerialize,
KeyDerivator: BorshSerialize,
impl Clone for KeyIdentifier
impl Clone for KeyIdentifier
fn clone(&self) -> KeyIdentifier
fn clone(&self) -> KeyIdentifier
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreimpl Debug for KeyIdentifier
impl Debug for KeyIdentifier
impl Derivable for KeyIdentifier
impl Derivable for KeyIdentifier
Derivable for KeyIdentifier
impl<'de> Deserialize<'de> for KeyIdentifier
impl<'de> Deserialize<'de> for KeyIdentifier
Serde compatible Deserialize
fn deserialize<D>(
deserializer: D
) -> Result<KeyIdentifier, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D
) -> Result<KeyIdentifier, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl FromStr for KeyIdentifier
impl FromStr for KeyIdentifier
From string to KeyIdentifier
fn from_str(s: &str) -> Result<KeyIdentifier, <KeyIdentifier as FromStr>::Err>
fn from_str(s: &str) -> Result<KeyIdentifier, <KeyIdentifier as FromStr>::Err>
Parses a string
s
to return a value of this type. Read moreimpl Hash for KeyIdentifier
impl Hash for KeyIdentifier
impl PartialEq<KeyIdentifier> for KeyIdentifier
impl PartialEq<KeyIdentifier> for KeyIdentifier
Partial equal for KeyIdentifier
fn eq(&self, other: &KeyIdentifier) -> bool
fn eq(&self, other: &KeyIdentifier) -> bool
impl PartialOrd<KeyIdentifier> for KeyIdentifier
impl PartialOrd<KeyIdentifier> for KeyIdentifier
fn partial_cmp(&self, other: &KeyIdentifier) -> Option<Ordering>
fn partial_cmp(&self, other: &KeyIdentifier) -> Option<Ordering>
1.0.0 · sourcefn 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 moreimpl Serialize for KeyIdentifier
impl Serialize for KeyIdentifier
Serde compatible Serialize
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
impl Eq for KeyIdentifier
impl StructuralEq for KeyIdentifier
Auto Trait Implementations
impl RefUnwindSafe for KeyIdentifier
impl Send for KeyIdentifier
impl Sync for KeyIdentifier
impl Unpin for KeyIdentifier
impl UnwindSafe for KeyIdentifier
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
Mutably borrows from an owned value. Read more
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
Compare self to
key
and return true
if they are equal.