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 name of the Error. This will be used to print the error.

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

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

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The lower-level source of this error, if any. Read more

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Implementations on Foreign Types

Allows Box to be treated as Bork

Implementors