pub struct MutableItem { /* private fields */ }
Expand description
BEP_0044’s Mutable item.
Implementations§
Source§impl MutableItem
impl MutableItem
Sourcepub fn new(
signer: SigningKey,
value: &[u8],
seq: i64,
salt: Option<&[u8]>,
) -> Self
pub fn new( signer: SigningKey, value: &[u8], seq: i64, salt: Option<&[u8]>, ) -> Self
Create a new mutable item from a signing key, value, sequence number and optional salt.
Sourcepub fn target_from_key(public_key: &[u8; 32], salt: Option<&[u8]>) -> Id
pub fn target_from_key(public_key: &[u8; 32], salt: Option<&[u8]>) -> Id
Return the target of a MutableItem by hashing its public_key
and an optional salt
Sourcepub fn new_signed_unchecked(
key: [u8; 32],
signature: [u8; 64],
value: &[u8],
seq: i64,
salt: Option<&[u8]>,
) -> Self
pub fn new_signed_unchecked( key: [u8; 32], signature: [u8; 64], value: &[u8], seq: i64, salt: Option<&[u8]>, ) -> Self
Create a new mutable item from an already signed value.
Sourcepub fn key(&self) -> &[u8; 32]
pub fn key(&self) -> &[u8; 32]
Returns a reference to the 32 bytes Ed25519 public key of this item.
Sourcepub fn salt(&self) -> Option<&[u8]>
pub fn salt(&self) -> Option<&[u8]>
Returns the Salt
value used for generating the
Self::target if any.
Trait Implementations§
Source§impl Clone for MutableItem
impl Clone for MutableItem
Source§fn clone(&self) -> MutableItem
fn clone(&self) -> MutableItem
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for MutableItem
impl Debug for MutableItem
Source§impl<'de> Deserialize<'de> for MutableItem
impl<'de> Deserialize<'de> for MutableItem
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 PartialEq for MutableItem
impl PartialEq for MutableItem
Source§impl Serialize for MutableItem
impl Serialize for MutableItem
impl StructuralPartialEq for MutableItem
Auto Trait Implementations§
impl Freeze for MutableItem
impl RefUnwindSafe for MutableItem
impl Send for MutableItem
impl Sync for MutableItem
impl Unpin for MutableItem
impl UnwindSafe for MutableItem
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