Settings
Help

EncodableItem

Trait EncodableItem 

pub trait EncodableItem: ItemType + Downcast {
    // Required method
    fn as_keystore_item(&self) -> Result<KeystoreItem, Error>;
}
Expand description

A key that can be serialized to, and deserialized from.

Required Methods§

fn as_keystore_item(&self) -> Result<KeystoreItem, Error>

Return the key as a [KeystoreItem].

Implementations§

§

impl dyn EncodableItem

pub fn is<__T>(&self) -> bool
where __T: EncodableItem,

Returns true if the trait object wraps an object of type __T.

pub fn downcast<__T>( self: Box<dyn EncodableItem>, ) -> Result<Box<__T>, Box<dyn EncodableItem>>
where __T: EncodableItem,

Returns a boxed object from a boxed trait object if the underlying object is of type __T. Returns the original boxed trait if it isn’t.

pub fn downcast_rc<__T>( self: Rc<dyn EncodableItem>, ) -> Result<Rc<__T>, Rc<dyn EncodableItem>>
where __T: EncodableItem,

Returns an Rc-ed object from an Rc-ed trait object if the underlying object is of type __T. Returns the original Rc-ed trait if it isn’t.

pub fn downcast_ref<__T>(&self) -> Option<&__T>
where __T: EncodableItem,

Returns a reference to the object within the trait object if it is of type __T, or None if it isn’t.

pub fn downcast_mut<__T>(&mut self) -> Option<&mut __T>
where __T: EncodableItem,

Returns a mutable reference to the object within the trait object if it is of type __T, or None if it isn’t.

Implementations on Foreign Types§

§

impl EncodableItem for EncodedEd25519Cert

§

fn as_keystore_item(&self) -> Result<KeystoreItem, Error>

§

impl EncodableItem for ExpandedKeypair

§

fn as_keystore_item(&self) -> Result<KeystoreItem, Error>

§

impl EncodableItem for Keypair

§

fn as_keystore_item(&self) -> Result<KeystoreItem, Error>

§

impl EncodableItem for PublicKey

§

fn as_keystore_item(&self) -> Result<KeystoreItem, Error>

§

impl EncodableItem for PublicKey

§

fn as_keystore_item(&self) -> Result<KeystoreItem, Error>

§

impl EncodableItem for StaticKeypair

§

fn as_keystore_item(&self) -> Result<KeystoreItem, Error>

Implementors§

impl EncodableItem for RelayIdentityKeypair

impl EncodableItem for RelayLinkSigningKeypair

impl EncodableItem for RelaySigningKeypair