Trait borked::BorkChain [−][src]
pub trait BorkChain: 'static { fn chain(&mut self, cause: Box<dyn BorkChain>) -> &dyn BorkChain; fn name(&self) -> String; fn cause(&self) -> Option<&'static dyn BorkChain>; fn new() -> Option<Box<Self>>
where
Self: Sized + BorkChain; fn __private_get_type_id__(&self) -> TypeId { ... } }
Expand description
Main Bork Trait. See BaseBork for an example implementation.
Required methods
Used to store Bork within the Bork referenced by self. The stored Error is considered to be the cause of the referenced Error. The stored error can then be retrieved with the cause() fn.
Get the cause of the error. This is set either at Instantiation of the Error, or through the chain fn.
Return a new Instantiation. Return type is an option, so None can be returned if it is otherwise inconvienient to implement this. The other traits BorkWithMsg and/or BorkNoMsg can be implemented instead for a method that is not Optional.
Provided methods
fn __private_get_type_id__(&self) -> TypeId
fn __private_get_type_id__(&self) -> TypeId
Used for downcasting Borks to their underlying type.
Implementations
Downcasting fn for BorkChain. Allows the original type of bork to be reconstructed.
This can be used to cast a BorkChain reference back to the concrete type that implements BorkChain.
Trait Implementations
Implementations on Foreign Types
Allows Box