error.scoped.ScopeError.into_value
Rust
- Python Unavailable
- TypeScript Unavailable
- Rust
- Go Unavailable
- Java Unavailable
- .NET Unavailable
- C++ Unavailable
- Swift Unavailable
- Module
- error.scoped
- Declared in
- ScopeError
- Package
- libtmux
- Source
- crates/libtmux/src/error/scoped.rs
-
Take the value the operation produced before cleanup failed.
Noneunless the operation succeeded, which is the one case where a result would otherwise be lost: the outerResultisErreither way.Examples
// The work is done even when tearing the session down failed, so the// value is worth keeping rather than discarding with the error.let outcome = server.with_session("build", async |session| {Ok::<_, libtmux::Error>(session.id().to_string())}).await;let id = match outcome {Ok(id) => Some(id),Err(error) => error.into_value(),};
0 declared, 0 inherited