Skip to main content

Callable

Trait Callable 

Source
pub trait Callable<In, Out = ()>
where In: 'static, Out: 'static,
{ // Required methods fn try_run(&self, input: In) -> Option<Out>; fn run(&self, input: In) -> Out; }
Expand description

A wrapper trait for calling callbacks.

Required Methods§

Source

fn try_run(&self, input: In) -> Option<Out>

calls the callback with the specified argument.

Returns None if the callback has been disposed

Source

fn run(&self, input: In) -> Out

calls the callback with the specified argument.

§Panics

Panics if you try to run a callback that has been disposed

Implementors§

Source§

impl<In, Out> Callable<In, Out> for Callback<In, Out>

Source§

impl<In, Out> Callable<In, Out> for UnsyncCallback<In, Out>
where In: 'static, Out: 'static,