Struct aleph_bft_rmc::Signed
source · pub struct Signed<T, K>where
T: Signable + Index,
K: Keychain,{ /* private fields */ }Expand description
A correctly signed object of type T.
The correctness is guaranteed by storing a (phantom) reference to the Keychain that verified
the signature.
Implementations§
source§impl<T, K> Signed<T, K>where
T: Signable + Index,
K: Keychain,
impl<T, K> Signed<T, K>where T: Signable + Index, K: Keychain,
sourcepub fn sign(signable: T, keychain: &K) -> Signed<T, K>
pub fn sign(signable: T, keychain: &K) -> Signed<T, K>
Create a signed object from a signable. The index of signable must match the index of the keychain.
sourcepub fn as_signable(&self) -> &T
pub fn as_signable(&self) -> &T
Get a reference to the signed object.
pub fn into_signable(self) -> T
pub fn into_unchecked(self) -> UncheckedSigned<T, <K as Keychain>::Signature>
source§impl<T, K> Signed<Indexed<T>, K>where
T: Signable,
K: Keychain,
impl<T, K> Signed<Indexed<T>, K>where T: Signable, K: Keychain,
sourcepub fn sign_with_index(signable: T, keychain: &K) -> Signed<Indexed<T>, K>
pub fn sign_with_index(signable: T, keychain: &K) -> Signed<Indexed<T>, K>
Create a signed object from a signable. The index is added based on the index of the keychain.
source§impl<T, MK> Signed<Indexed<T>, MK>where
T: Signable,
MK: MultiKeychain,
impl<T, MK> Signed<Indexed<T>, MK>where T: Signable, MK: MultiKeychain,
sourcepub fn into_partially_multisigned(
self,
keychain: &MK
) -> PartiallyMultisigned<T, MK>
pub fn into_partially_multisigned( self, keychain: &MK ) -> PartiallyMultisigned<T, MK>
Transform a singly signed object into a partially multisigned consisting of just the signed object. Note that depending on the setup, it may yield a complete signature.
Trait Implementations§
source§impl<T, K> Debug for Signed<T, K>where
T: Debug + Signable + Index,
K: Debug + Keychain,
<K as Keychain>::Signature: Debug,
impl<T, K> Debug for Signed<T, K>where T: Debug + Signable + Index, K: Debug + Keychain, <K as Keychain>::Signature: Debug,
source§impl<T, K> Decode for Signed<T, K>where
T: Signable + Index,
K: Keychain,
UncheckedSigned<T, <K as Keychain>::Signature>: Decode,
impl<T, K> Decode for Signed<T, K>where T: Signable + Index, K: Keychain, UncheckedSigned<T, <K as Keychain>::Signature>: Decode,
source§fn decode<__CodecInputEdqy>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<Signed<T, K>, Error>where
__CodecInputEdqy: Input,
fn decode<__CodecInputEdqy>( __codec_input_edqy: &mut __CodecInputEdqy ) -> Result<Signed<T, K>, Error>where __CodecInputEdqy: Input,
Attempt to deserialise the value from input.
source§fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>
) -> Result<DecodeFinished, Error>where
I: Input,
fn decode_into<I>( input: &mut I, dst: &mut MaybeUninit<Self> ) -> Result<DecodeFinished, Error>where I: Input,
Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
source§impl<T, K> Encode for Signed<T, K>where
T: Signable + Index,
K: Keychain,
UncheckedSigned<T, <K as Keychain>::Signature>: Encode,
impl<T, K> Encode for Signed<T, K>where T: Signable + Index, K: Keychain, UncheckedSigned<T, <K as Keychain>::Signature>: Encode,
source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
If possible give a hint of expected size of the encoding. Read more
source§fn encode_to<__CodecOutputEdqy>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy
)where
__CodecOutputEdqy: Output + ?Sized,
fn encode_to<__CodecOutputEdqy>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy )where __CodecOutputEdqy: Output + ?Sized,
Convert self to a slice and append it to the destination.
source§fn using_encoded<R, F>(&self, f: F) -> Rwhere
F: FnOnce(&[u8]) -> R,
fn using_encoded<R, F>(&self, f: F) -> Rwhere F: FnOnce(&[u8]) -> R,
Convert self to a slice and then invoke the given closure with it.
source§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Calculates the encoded size. Read more
source§impl<T, K> From<Signed<T, K>> for UncheckedSigned<T, <K as Keychain>::Signature>where
T: Signable + Index,
K: Keychain,
impl<T, K> From<Signed<T, K>> for UncheckedSigned<T, <K as Keychain>::Signature>where T: Signable + Index, K: Keychain,
source§impl<T, K> Hash for Signed<T, K>where
T: Hash + Signable + Index,
K: Hash + Keychain,
<K as Keychain>::Signature: Hash,
impl<T, K> Hash for Signed<T, K>where T: Hash + Signable + Index, K: Hash + Keychain, <K as Keychain>::Signature: Hash,
source§impl<T, K> PartialEq for Signed<T, K>where
T: PartialEq + Signable + Index,
K: PartialEq + Keychain,
<K as Keychain>::Signature: PartialEq,
impl<T, K> PartialEq for Signed<T, K>where T: PartialEq + Signable + Index, K: PartialEq + Keychain, <K as Keychain>::Signature: PartialEq,
impl<T, K> EncodeLike for Signed<T, K>where T: Signable + Index, K: Keychain, UncheckedSigned<T, <K as Keychain>::Signature>: Encode,
impl<T, K> Eq for Signed<T, K>where T: Eq + Signable + Index, K: Eq + Keychain, <K as Keychain>::Signature: Eq,
impl<T, K> StructuralEq for Signed<T, K>where T: Signable + Index, K: Keychain,
impl<T, K> StructuralPartialEq for Signed<T, K>where T: Signable + Index, K: Keychain,
Auto Trait Implementations§
impl<T, K> RefUnwindSafe for Signed<T, K>where T: RefUnwindSafe, <K as Keychain>::Signature: RefUnwindSafe,
impl<T, K> Send for Signed<T, K>where T: Send,
impl<T, K> Sync for Signed<T, K>where T: Sync,
impl<T, K> Unpin for Signed<T, K>where T: Unpin, <K as Keychain>::Signature: Unpin,
impl<T, K> UnwindSafe for Signed<T, K>where T: UnwindSafe, <K as Keychain>::Signature: UnwindSafe,
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