wasmrs_runtime/error.rs
1//! Library-specific error types and utility functions
2
3/// Error type for wasmRS Runtime errors.
4#[allow(missing_copy_implementations)]
5#[derive(Debug, Clone)]
6pub enum Error {
7 /// Sending on the channel failed.
8 SendFailed(u8),
9 /// Receiving from the channel failed.
10 RecvFailed(u8),
11}
12
13impl std::error::Error for Error {}
14impl std::fmt::Display for Error {
15 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16 match self {
17 Error::SendFailed(_) => f.write_str("Send failed"),
18 Error::RecvFailed(_) => f.write_str("Receive failed"),
19 }
20 }
21}