Trait IntoOptionalGStr

pub trait IntoOptionalGStr {
    // Required method
    fn run_with_gstr<T, F>(self, f: F) -> T
       where F: FnOnce(Option<&GStr>) -> T;
}
Expand description

A trait to accept both Option<&str> or Option<&GStr> as an argument.

Required Methods§

fn run_with_gstr<T, F>(self, f: F) -> T
where F: FnOnce(Option<&GStr>) -> T,

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.

Implementations on Foreign Types§

§

impl<S> IntoOptionalGStr for Option<S>
where S: IntoGStr,

§

fn run_with_gstr<T, F>(self, f: F) -> T
where F: FnOnce(Option<&GStr>) -> T,

Implementors§