ScopeError.into_value
Take the value the operation produced before cleanup failed.
Source and package
- Qualified name
-
libtmux::error:: scoped:: Scope Error:: into _value - Module
- error.scoped
- Declared in
ScopeError- Package
- libtmux
- Source
- crates/libtmux/src/error/scoped.rs
-
Description#
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(),};- Type parameters
-
-
Tdeclared byScopeError<T, E>
-