Registry / utility / thiserror-no-std

thiserror-no-std

JSON →
library2.0.2rscratesunverified

A no_std compatible derive macro for the Error trait.

# Cargo.toml [dependencies] thiserror-no-std = "2.0.2"
INSTALL
IMPORT
SIG · THISERROR-NO-STD
T
thiserror-no-std
utilityrustv2.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Error
use thiserror_no_std::Error;

Define a custom error type using thiserror-no-std.

use thiserror_no_std::Error; #[derive(Error, Debug)] pub enum MyError { #[error("io error: {0}")] Io(#[from] std::io::Error), } fn main() { let err = MyError::Io(std::io::Error::new(std::io::ErrorKind::Other, "oh no")); println!("{}", err); }
Debug
Known issues
gotchaThis is a fork of `thiserror` for no_std environments; may lag behind upstream.
fix
Use `thiserror` if you don't need no_std support.
affects: >=2.0.0
Upgrade
Version history
2.0.2latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
thiserror-no-std — cargo add thiserror-no-std · libregistry