docs.rs failed to build yoshi-0.1.5
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
yoshi-0.1.4
yoshi
The main entry point for the Yoshi error handling framework. This is what you want to add to your Cargo.toml
.
What's this?
This crate re-exports everything from the Yoshi framework in one convenient package. Instead of importing yoshi-std
, yoshi-derive
, etc. separately, just use yoshi
.
Installation
[]
= "0.1"
# With derive macros and serialization
= { = "0.1", = ["derive", "serde"] }
# Everything enabled
= { = "0.1", = ["full"] }
Usage
# Using the `yoshi!` Macro
The `yoshi!` macro provides a quick way to create structured errors with context.
## Basic Usage
```rust
use *;
Quick Error Creation
use *;
// Simple error
let error = yoshi!;
// With context
let error = yoshi!;
// With multiple context and suggestions
let error = yoshi!;
Bail-style Usage
use *;
Format String Support
use *;
Real-World Example
use *;
async
Macro Variants
use *;
// Basic error creation
yoshi!
// With format string
yoshi!
// With context
yoshi!
// Bail out of function (equivalent to return Err(...))
bail!
// Ensure condition (equivalent to if !condition { bail!(...) })
ensure!
The yoshi!
macro makes error creation concise while maintaining Yoshi's structured approach with rich context and metadata.
What gets re-exported
From | What |
---|---|
yoshi-std |
Yoshi , YoshiKind , YoContext , Result |
yoshi-derive |
YoshiError derive macro (with derive feature) |
Features
Feature | Description |
---|---|
std |
Standard library support (default) |
derive |
Re-exports yoshi-derive macros |
serde |
Serialization support |
tracing |
Tracing integration |
full |
Enables all features |
Examples
Check out the examples directory for real-world usage patterns.
License
Licensed under either of Apache License, Version 2.0 or MIT License at your option.