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§
Sourcefn as_keystore_item(&self) -> Result<KeystoreItem, Error>
fn as_keystore_item(&self) -> Result<KeystoreItem, Error>
Return the key as a KeystoreItem
.
Implementations§
Source§impl dyn EncodableItem
impl dyn EncodableItem
Sourcepub fn is<__T>(&self) -> boolwhere
__T: EncodableItem,
pub fn is<__T>(&self) -> boolwhere
__T: EncodableItem,
Returns true if the trait object wraps an object of type __T
.
Sourcepub fn downcast<__T>(
self: Box<dyn EncodableItem>,
) -> Result<Box<__T>, Box<dyn EncodableItem>>where
__T: EncodableItem,
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.
Sourcepub fn downcast_rc<__T>(
self: Rc<dyn EncodableItem>,
) -> Result<Rc<__T>, Rc<dyn EncodableItem>>where
__T: EncodableItem,
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.
Sourcepub fn downcast_ref<__T>(&self) -> Option<&__T>where
__T: EncodableItem,
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.
Sourcepub fn downcast_mut<__T>(&mut self) -> Option<&mut __T>where
__T: EncodableItem,
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.