[][src]Struct clint::Handler

pub struct Handler { /* fields omitted */ }

Methods

impl Handler[src]

pub const fn new() -> Self[src]

Returns a new Handler that initially does nothing when called. Override it's behavior by using replace.

pub unsafe fn replace<F>(&mut self, f: &F) where
    F: FnMut() + 'static, 
[src]

Replace the behavior of this handler with f.

Safety

There is no exclusion on replacing the handler's behavior while it is being executed. It is your responsibility to make sure that it's not being executed when you call replace.

pub unsafe fn call(&self)[src]

Execute this handler.

Safety

This function assumes that a replace is not occurring when the closure is being looked up. You need to ensure that replace and call can not occur at the same time.

pub fn default_handler()[src]

Do nothing handler. Needed by call until replace is used to set specific behavior. Can also be used to replace a closure that is about to go out of scope.

Trait Implementations

impl Debug for Handler[src]

Auto Trait Implementations

impl !Send for Handler

impl !Sync for Handler

Blanket Implementations

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]