[][src]Trait operator_framework::utils::UseOrCreate

pub trait UseOrCreate<T> {
    fn use_or_create<F, R>(&mut self, f: F) -> R
    where
        F: FnOnce(&mut T) -> R
; fn use_or_create_err<F>(&mut self, f: F) -> Result<()>
    where
        F: FnOnce(&mut T) -> Result<()>
, { ... } }

Use the value of something optional, or create it first.

Required methods

fn use_or_create<F, R>(&mut self, f: F) -> R where
    F: FnOnce(&mut T) -> R, 

Loading content...

Provided methods

fn use_or_create_err<F>(&mut self, f: F) -> Result<()> where
    F: FnOnce(&mut T) -> Result<()>, 

Loading content...

Implementations on Foreign Types

impl<T> UseOrCreate<T> for Option<T> where
    T: Default
[src]

Implementation for Options which wrap Defaults.

Loading content...

Implementors

Loading content...