pub trait WithResult: Sized {
// Required methods
fn result(&self) -> Option<&RustType>;
fn set_result<T>(&mut self, result: T)
where T: Into<RustType>;
// Provided methods
fn with_result<T>(self, result: T) -> Self
where T: Into<RustType> { ... }
fn write_result(&self, b: &mut CodeBuffer) { ... }
}Expand description
An element with an optional result.
Required Methods§
Sourcefn set_result<T>(&mut self, result: T)
fn set_result<T>(&mut self, result: T)
Sets the result.
Provided Methods§
Sourcefn with_result<T>(self, result: T) -> Self
fn with_result<T>(self, result: T) -> Self
Sets the result.
Sourcefn write_result(&self, b: &mut CodeBuffer)
fn write_result(&self, b: &mut CodeBuffer)
Writes the optional result. (includes the -> if the result is not None)
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.