[][src]Struct queen::Callback

pub struct Callback<T> {
    pub accept_fn: Option<Box<dyn Fn(&Session, &T) -> bool + Send>>,
    pub remove_fn: Option<Box<dyn Fn(&Session, &T) + Send>>,
    pub recv_fn: Option<Box<dyn Fn(&Session, &mut Message, &T) -> bool + Send>>,
    pub send_fn: Option<Box<dyn Fn(&Session, &mut Message, &T) -> bool + Send>>,
    pub auth_fn: Option<Box<dyn Fn(&Session, &mut Message, &T) -> bool + Send>>,
    pub attach_fn: Option<Box<dyn Fn(&Session, &mut Message, &T) -> bool + Send>>,
    pub detach_fn: Option<Box<dyn Fn(&Session, &mut Message, &T) + Send>>,
    pub emit_fn: Option<Box<dyn Fn(&Session, &mut Message, &T) -> bool + Send>>,
    pub push_fn: Option<Box<dyn Fn(&Session, &mut Message, &T) -> bool + Send>>,
    pub kill_fn: Option<Box<dyn Fn(&Session, &mut Message, &T) -> bool + Send>>,
    pub custom_fn: Option<Box<dyn Fn(&Sessions, usize, &mut Message, &T) + Send>>,
}

Fields

accept_fn: Option<Box<dyn Fn(&Session, &T) -> bool + Send>>remove_fn: Option<Box<dyn Fn(&Session, &T) + Send>>recv_fn: Option<Box<dyn Fn(&Session, &mut Message, &T) -> bool + Send>>send_fn: Option<Box<dyn Fn(&Session, &mut Message, &T) -> bool + Send>>auth_fn: Option<Box<dyn Fn(&Session, &mut Message, &T) -> bool + Send>>attach_fn: Option<Box<dyn Fn(&Session, &mut Message, &T) -> bool + Send>>detach_fn: Option<Box<dyn Fn(&Session, &mut Message, &T) + Send>>emit_fn: Option<Box<dyn Fn(&Session, &mut Message, &T) -> bool + Send>>push_fn: Option<Box<dyn Fn(&Session, &mut Message, &T) -> bool + Send>>kill_fn: Option<Box<dyn Fn(&Session, &mut Message, &T) -> bool + Send>>custom_fn: Option<Box<dyn Fn(&Sessions, usize, &mut Message, &T) + Send>>

Methods

impl<T> Callback<T>[src]

pub fn new() -> Callback<T>[src]

pub fn accept<F>(&mut self, f: F) where
    F: Fn(&Session, &T) -> bool + Send + 'static, 
[src]

pub fn remove<F>(&mut self, f: F) where
    F: Fn(&Session, &T) + Send + 'static, 
[src]

pub fn recv<F>(&mut self, f: F) where
    F: Fn(&Session, &mut Message, &T) -> bool + Send + 'static, 
[src]

pub fn send<F>(&mut self, f: F) where
    F: Fn(&Session, &mut Message, &T) -> bool + Send + 'static, 
[src]

pub fn auth<F>(&mut self, f: F) where
    F: Fn(&Session, &mut Message, &T) -> bool + Send + 'static, 
[src]

pub fn attach<F>(&mut self, f: F) where
    F: Fn(&Session, &mut Message, &T) -> bool + Send + 'static, 
[src]

pub fn detach<F>(&mut self, f: F) where
    F: Fn(&Session, &mut Message, &T) + Send + 'static, 
[src]

pub fn emit<F>(&mut self, f: F) where
    F: Fn(&Session, &mut Message, &T) -> bool + Send + 'static, 
[src]

pub fn push<F>(&mut self, f: F) where
    F: Fn(&Session, &mut Message, &T) -> bool + Send + 'static, 
[src]

pub fn kill<F>(&mut self, f: F) where
    F: Fn(&Session, &mut Message, &T) -> bool + Send + 'static, 
[src]

pub fn custom<F>(&mut self, f: F) where
    F: Fn(&Sessions, usize, &mut Message, &T) + Send + 'static, 
[src]

Trait Implementations

impl<T> Default for Callback<T>[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for Callback<T>

impl<T> Send for Callback<T>

impl<T> !Sync for Callback<T>

impl<T> Unpin for Callback<T>

impl<T> !UnwindSafe for Callback<T>

Blanket Implementations

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

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

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

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

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

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> 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<V, T> VZip<V> for T where
    V: MultiLane<T>,