[][src]Enum sp_core::ecdsa::Public

pub enum Public {
    Full([u8; 64]),
    Compressed([u8; 33]),
}

The ECDSA public key.

Variants

Full([u8; 64])

A full raw ECDSA public key.

Compressed([u8; 33])

A compressed ECDSA public key.

Methods

impl Public[src]

pub fn from_raw(data: [u8; 64]) -> Self[src]

A new instance from the given 64-byte data.

NOTE: No checking goes on to ensure this is a real public key. Only use it if you are certain that the array actually is a pubkey. GIGO!

pub fn from_full(data: [u8; 65]) -> Self[src]

A new instance from the given 65-byte data.

NOTE: No checking goes on to ensure this is a real public key. Only use it if you are certain that the array actually is a pubkey. GIGO!

pub fn as_compressed(&self) -> Result<[u8; 33], ()>[src]

Return in compressed format.

Returns an error if self is an invalid full public key.

pub fn into_compressed(self) -> Result<Self, ()>[src]

Convert Self into a compressed public key.

Returns an error if self is an invalid full public key.

Trait Implementations

impl AsMut<[u8]> for Public[src]

impl AsRef<[u8]> for Public[src]

impl Clone for Public[src]

impl CryptoType for Public[src]

type Pair = Pair

The pair key type of this crypto.

impl Debug for Public[src]

impl Decode for Public[src]

impl Default for Public[src]

impl Derive for Public[src]

impl<'de> Deserialize<'de> for Public[src]

impl Display for Public[src]

impl Encode for Public[src]

impl EncodeLike<Public> for Public[src]

impl Eq for Public[src]

impl From<Pair> for Public[src]

impl Hash for Public[src]

impl Ord for Public[src]

impl PartialEq<Public> for Public[src]

impl PartialOrd<Public> for Public[src]

impl Public for Public[src]

fn from_slice(data: &[u8]) -> Self[src]

A new instance from the given slice that should be 33 bytes long.

NOTE: No checking goes on to ensure this is a real public key. Only use it if you are certain that the array actually is a pubkey. GIGO!

impl Serialize for Public[src]

impl<'_> TryFrom<&'_ [u8]> for Public[src]

type Error = ()

The type returned in the event of a conversion error.

impl UncheckedFrom<[u8; 64]> for Public[src]

Auto Trait Implementations

impl RefUnwindSafe for Public

impl Send for Public

impl Sync for Public

impl Unpin for Public

impl UnwindSafe for Public

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Clear for T where
    T: InitializableFromZeroed + ?Sized
[src]

impl<S> Codec for S where
    S: Encode + Decode
[src]

impl<T, X> Decode for X where
    T: Decode + Into<X>,
    X: WrapperTypeDecode<Wrapped = T>, 
[src]

impl<T> DecodeAll for T where
    T: Decode
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T, X> Encode for X where
    T: Encode + ?Sized,
    X: WrapperTypeEncode<Target = T>, 
[src]

impl<'_, '_, T> EncodeLike<&'_ &'_ T> for T where
    T: Encode
[src]

impl<'_, T> EncodeLike<&'_ T> for T where
    T: Encode
[src]

impl<'_, T> EncodeLike<&'_ mut T> for T where
    T: Encode
[src]

impl<T> EncodeLike<Arc<T>> for T where
    T: Encode
[src]

impl<T> EncodeLike<Box<T>> for T where
    T: Encode
[src]

impl<'a, T> EncodeLike<Cow<'a, T>> for T where
    T: Encode + ToOwned
[src]

impl<T> EncodeLike<Rc<T>> for T where
    T: Encode
[src]

impl<T> From<T> for T[src]

impl<S> FullCodec for S where
    S: Decode + FullEncode
[src]

impl<S> FullEncode for S where
    S: Encode + EncodeLike<S>, 
[src]

impl<T> InitializableFromZeroed for T where
    T: Default
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, Outer> IsWrappedBy<Outer> for T where
    Outer: AsRef<T> + AsMut<T> + From<T>,
    T: From<Outer>, 
[src]

fn from_ref(&Outer) -> &T[src]

Get a reference to the inner from the outer.

fn from_mut(&mut Outer) -> &mut T[src]

Get a mutable reference to the inner from the outer.

impl<T> KeyedVec for T where
    T: Codec
[src]

impl<T> MaybeDebug for T where
    T: Debug
[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> Ss58Codec for T where
    T: Derive + AsRef<[u8]> + AsMut<[u8]> + Default
[src]

impl<T> ToHex for T where
    T: AsRef<[u8]>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<Inner, Outer, T> UncheckedFrom<T> for Outer where
    Inner: IsWrappedBy<Outer> + UncheckedFrom<T>,
    Outer: Wraps<Inner = Inner>, 
[src]

impl<S, T> UncheckedInto<T> for S where
    T: UncheckedFrom<S>, 
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]