WithResult

Trait WithResult 

Source
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§

Source

fn result(&self) -> Option<&RustType>

Gets the optional result.

Source

fn set_result<T>(&mut self, result: T)
where T: Into<RustType>,

Sets the result.

Provided Methods§

Source

fn with_result<T>(self, result: T) -> Self
where T: Into<RustType>,

Sets the result.

Source

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.

Implementors§