Struct sp_application_crypto::ecdsa::Signature
source · pub struct Signature(pub [u8; 65]);
Expand description
A signature (a 512-bit value, plus 8 bits for recovery ID).
Tuple Fields§
§0: [u8; 65]
Implementations§
source§impl Signature
impl Signature
sourcepub fn from_raw(data: [u8; 65]) -> Signature
pub fn from_raw(data: [u8; 65]) -> Signature
A new instance from the given 65-byte data
.
NOTE: No checking goes on to ensure this is a real signature. Only use it if you are certain that the array actually is a signature. GIGO!
sourcepub fn from_slice(data: &[u8]) -> Option<Signature>
pub fn from_slice(data: &[u8]) -> Option<Signature>
A new instance from the given slice that should be 65 bytes long.
NOTE: No checking goes on to ensure this is a real signature. Only use it if you are certain that the array actually is a signature. GIGO!
Trait Implementations§
source§impl Decode for Signature
impl Decode for Signature
source§fn decode<__CodecInputEdqy>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<Signature, Error>where
__CodecInputEdqy: Input,
fn decode<__CodecInputEdqy>( __codec_input_edqy: &mut __CodecInputEdqy ) -> Result<Signature, Error>where __CodecInputEdqy: Input,
Attempt to deserialise the value from input.
§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
§fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
fn skip<I>(input: &mut I) -> Result<(), Error>where I: Input,
Attempt to skip the encoded value from input. Read more
§fn encoded_fixed_size() -> Option<usize>
fn encoded_fixed_size() -> Option<usize>
Returns the fixed encoded size of the type. Read more
source§impl<'de> Deserialize<'de> for Signature
impl<'de> Deserialize<'de> for Signature
source§fn deserialize<D>(
deserializer: D
) -> Result<Signature, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>( deserializer: D ) -> Result<Signature, <D as Deserializer<'de>>::Error>where D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Encode for Signature
impl Encode for Signature
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.
§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Calculates the encoded size. Read more
source§impl MaxEncodedLen for Signature
impl MaxEncodedLen for Signature
source§fn max_encoded_len() -> usize
fn max_encoded_len() -> usize
Upper bound, in bytes, of the maximum encoded size of this item.
source§impl PartialEq<Signature> for Signature
impl PartialEq<Signature> for Signature
source§impl PassByInner for Signature
impl PassByInner for Signature
source§fn into_inner(self) -> <Signature as PassByInner>::Inner
fn into_inner(self) -> <Signature as PassByInner>::Inner
Consumes
self
and returns the inner type.source§fn inner(&self) -> &<Signature as PassByInner>::Inner
fn inner(&self) -> &<Signature as PassByInner>::Inner
Returns the reference to the inner type.
source§fn from_inner(inner: <Signature as PassByInner>::Inner) -> Signature
fn from_inner(inner: <Signature as PassByInner>::Inner) -> Signature
Construct
Self
from the given inner
.source§impl Serialize for Signature
impl Serialize for Signature
source§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 EncodeLike<Signature> for Signature
impl Eq for Signature
impl StructuralEq for Signature
impl StructuralPartialEq for Signature
Auto Trait Implementations§
impl RefUnwindSafe for Signature
impl Send for Signature
impl Sync for Signature
impl Unpin for Signature
impl UnwindSafe for Signature
Blanket Implementations§
§impl<T, U> AsByteSlice<T> for Uwhere
T: ToByteSlice,
U: AsRef<[T]> + ?Sized,
impl<T, U> AsByteSlice<T> for Uwhere T: ToByteSlice, U: AsRef<[T]> + ?Sized,
fn as_byte_slice(&self) -> &[u8] ⓘ
§impl<T, U> AsMutByteSlice<T> for Uwhere
T: ToMutByteSlice,
U: AsMut<[T]> + ?Sized,
impl<T, U> AsMutByteSlice<T> for Uwhere T: ToMutByteSlice, U: AsMut<[T]> + ?Sized,
fn as_mut_byte_slice(&mut self) -> &mut [u8] ⓘ
§impl<U> AsMutSliceOf for Uwhere
U: AsMut<[u8]> + ?Sized,
impl<U> AsMutSliceOf for Uwhere U: AsMut<[u8]> + ?Sized,
fn as_mut_slice_of<T>(&mut self) -> Result<&mut [T], Error>where T: FromByteSlice,
§impl<U> AsSliceOf for Uwhere
U: AsRef<[u8]> + ?Sized,
impl<U> AsSliceOf for Uwhere U: AsRef<[u8]> + ?Sized,
fn as_slice_of<T>(&self) -> Result<&[T], Error>where T: FromByteSlice,
§impl<T> DecodeAll for Twhere
T: Decode,
impl<T> DecodeAll for Twhere T: Decode,
§fn decode_all(input: &mut &[u8]) -> Result<T, Error>
fn decode_all(input: &mut &[u8]) -> Result<T, Error>
Decode
Self
and consume all of the given input data. Read more§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere T: Decode,
source§impl<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,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<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,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
source§impl<T> FromFFIValue for Twhere
T: PassBy,
impl<T> FromFFIValue for Twhere T: PassBy,
§type SelfInstance = T
type SelfInstance = T
As
Self
can be an unsized type, it needs to be represented by a sized type at the host.
This SelfInstance
is the sized type.source§fn from_ffi_value(
context: &mut dyn FunctionContext,
arg: <<T as PassBy>::PassBy as RIType>::FFIType
) -> Result<T, String>
fn from_ffi_value( context: &mut dyn FunctionContext, arg: <<T as PassBy>::PassBy as RIType>::FFIType ) -> Result<T, String>
Create
SelfInstance
from the givensource§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoFFIValue for Twhere
T: PassBy,
impl<T> IntoFFIValue for Twhere T: PassBy,
source§fn into_ffi_value(
self,
context: &mut dyn FunctionContext
) -> Result<<<T as PassBy>::PassBy as RIType>::FFIType, String>
fn into_ffi_value( self, context: &mut dyn FunctionContext ) -> Result<<<T as PassBy>::PassBy as RIType>::FFIType, String>
Convert
self
into a ffi value.source§impl<T, Outer> IsWrappedBy<Outer> for Twhere
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
impl<T, Outer> IsWrappedBy<Outer> for Twhere Outer: AsRef<T> + AsMut<T> + From<T>, T: From<Outer>,
§impl<T> KeyedVec for Twhere
T: Codec,
impl<T> KeyedVec for Twhere T: Codec,
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> ToHex for Twhere
T: AsRef<[u8]>,
impl<T> ToHex for Twhere T: AsRef<[u8]>,
source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Lower case
letters are used (e.g. f9b4ca
)source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Upper case
letters are used (e.g. F9B4CA
)source§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere T: UncheckedFrom<S>,
source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to
unchecked_from
.