Struct aleph_bft_crypto::Signed
source · pub struct Signed<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: Signable + Index, K: Keychain> Signed<T, K>
impl<T: Signable + Index, K: Keychain> Signed<T, K>
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::Signature>
source§impl<T: Signable, K: Keychain> Signed<Indexed<T>, K>
impl<T: Signable, K: Keychain> Signed<Indexed<T>, K>
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: Signable, MK: MultiKeychain> Signed<Indexed<T>, MK>
impl<T: Signable, MK: MultiKeychain> Signed<Indexed<T>, MK>
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: Signable + Index, K: Keychain> Decode for Signed<T, K>
impl<T: Signable + Index, K: Keychain> Decode for Signed<T, K>
source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<Self, Error>
fn decode<__CodecInputEdqy: Input>( __codec_input_edqy: &mut __CodecInputEdqy ) -> Result<Self, Error>
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: Signable + Index, K: Keychain> Encode for Signed<T, K>
impl<T: Signable + Index, K: Keychain> Encode for Signed<T, K>
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: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy
)
fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy )
Convert self to a slice and append it to the destination.
source§fn using_encoded<__CodecOutputReturn, __CodecUsingEncodedCallback: FnOnce(&[u8]) -> __CodecOutputReturn>(
&self,
f: __CodecUsingEncodedCallback
) -> __CodecOutputReturn
fn using_encoded<__CodecOutputReturn, __CodecUsingEncodedCallback: FnOnce(&[u8]) -> __CodecOutputReturn>( &self, f: __CodecUsingEncodedCallback ) -> __CodecOutputReturn
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: Signable + Index, K: Keychain> From<Signed<T, K>> for UncheckedSigned<T, K::Signature>
impl<T: Signable + Index, K: Keychain> From<Signed<T, K>> for UncheckedSigned<T, K::Signature>
source§impl<T: PartialEq + Signable + Index, K: PartialEq + Keychain> PartialEq for Signed<T, K>
impl<T: PartialEq + Signable + Index, K: PartialEq + Keychain> PartialEq for Signed<T, K>
impl<T: Signable + Index, K: Keychain> EncodeLike for Signed<T, K>
impl<T: Eq + Signable + Index, K: Eq + Keychain> Eq for Signed<T, K>
impl<T: Signable + Index, K: Keychain> StructuralPartialEq for Signed<T, K>
Auto Trait Implementations§
impl<T, K> Freeze for Signed<T, K>
impl<T, K> RefUnwindSafe for Signed<T, K>
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>
impl<T, K> UnwindSafe for Signed<T, K>
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