pub trait ErrorCode:
Debug
+ Display
+ Clone
+ Send
+ Sync
+ 'static {
// Required methods
fn code(&self) -> i32;
fn from_code(code: i32) -> Option<Self>
where Self: Sized;
}Expand description
Trait for defining module-specific error codes.
This trait should be implemented by enums that represent different error categories in greenlight. The error codes should be unique integers that can be serialized and transmitted over the network.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl ErrorCode for ClnRpcError
Implementation of ErrorCode for CLN RPC errors.
This implementation treats all i32 values as valid error codes, allowing us to preserve any error code returned by CLN without loss.