pub struct ProgramError(/* private fields */);Expand description
Generic error type for RPC program implementations.
Wraps any thread-safe error for use by generated RPC service traits.
Generated dispatchers map a returned ProgramError to
RpcError::SystemError; the underlying
error is not sent to the peer.
§Example
use rpc_api::ProgramError;
fn load_config() -> Result<Vec<u8>, ProgramError> {
let bytes = std::fs::read("config.bin")?;
Ok(bytes)
}Implementations§
Trait Implementations§
Source§impl Debug for ProgramError
impl Debug for ProgramError
Source§impl Display for ProgramError
impl Display for ProgramError
Source§impl Error for ProgramError
impl Error for ProgramError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for ProgramError
impl !UnwindSafe for ProgramError
impl Freeze for ProgramError
impl Send for ProgramError
impl Sync for ProgramError
impl Unpin for ProgramError
impl UnsafeUnpin for ProgramError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more