pub struct Signed<T, K>{ /* private fields */ }
Expand description
A correctly signed object of type T
.
Implementations§
Source§impl<T, K> Signed<T, K>
impl<T, K> 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 as Keychain>::Signature>
Source§impl<T, K> Signed<Indexed<T>, K>
impl<T, K> 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, 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> Decode for Signed<T, K>
impl<T, K> Decode for Signed<T, K>
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>
impl<T, K> 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>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy,
)
fn encode_to<__CodecOutputEdqy>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy, )
Convert self to a slice and append it to the destination.
Source§fn using_encoded<__CodecOutputReturn, __CodecUsingEncodedCallback>(
&self,
f: __CodecUsingEncodedCallback,
) -> __CodecOutputReturn
fn using_encoded<__CodecOutputReturn, __CodecUsingEncodedCallback>( &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
impl<T, K> EncodeLike for Signed<T, K>
impl<T, K> Eq for Signed<T, K>
impl<T, K> 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere
T: Decode,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more