Struct mediator::DefaultMediatorBuilder
source · [−]pub struct DefaultMediatorBuilder { /* private fields */ }
Expand description
A builder for the DefaultMediator.
Implementations
sourceimpl DefaultMediatorBuilder
impl DefaultMediatorBuilder
sourcepub fn add_handler<Req, Res, H>(self, handler: H) -> Self where
Res: 'static,
Req: Request<Res> + 'static,
H: RequestHandler<Req, Res> + 'static,
pub fn add_handler<Req, Res, H>(self, handler: H) -> Self where
Res: 'static,
Req: Request<Res> + 'static,
H: RequestHandler<Req, Res> + 'static,
Registers a request handler.
sourcepub fn add_handler_fn<Req, Res, F>(self, handler: F) -> Self where
Res: 'static,
Req: Request<Res> + 'static,
F: FnMut(Req) -> Res + 'static,
pub fn add_handler_fn<Req, Res, F>(self, handler: F) -> Self where
Res: 'static,
Req: Request<Res> + 'static,
F: FnMut(Req) -> Res + 'static,
Registers a request handler from a function.
sourcepub fn add_handler_deferred<Req, Res, H, F>(self, f: F) -> Self where
Res: 'static,
Req: Request<Res> + 'static,
H: RequestHandler<Req, Res> + 'static,
F: Fn(DefaultMediator) -> H,
pub fn add_handler_deferred<Req, Res, H, F>(self, f: F) -> Self where
Res: 'static,
Req: Request<Res> + 'static,
H: RequestHandler<Req, Res> + 'static,
F: Fn(DefaultMediator) -> H,
Register a request handler using a copy of the mediator.
sourcepub fn add_handler_fn_deferred<Req, Res, H, F>(self, f: F) -> Self where
Res: 'static,
Req: Request<Res> + 'static,
H: FnMut(Req) -> Res + 'static,
F: Fn(DefaultMediator) -> H + 'static,
pub fn add_handler_fn_deferred<Req, Res, H, F>(self, f: F) -> Self where
Res: 'static,
Req: Request<Res> + 'static,
H: FnMut(Req) -> Res + 'static,
F: Fn(DefaultMediator) -> H + 'static,
Registers a request handler from a function using a copy of the mediator.
sourcepub fn subscribe<E, H>(self, handler: H) -> Self where
E: Event + 'static,
H: EventHandler<E> + 'static,
pub fn subscribe<E, H>(self, handler: H) -> Self where
E: Event + 'static,
H: EventHandler<E> + 'static,
Registers an event handler.
sourcepub fn subscribe_fn<E, F>(self, handler: F) -> Self where
E: Event + 'static,
F: FnMut(E) + 'static,
pub fn subscribe_fn<E, F>(self, handler: F) -> Self where
E: Event + 'static,
F: FnMut(E) + 'static,
Registers an event handler from a function.
sourcepub fn subscribe_deferred<E, H, F>(self, f: F) -> Self where
E: Event + 'static,
H: EventHandler<E> + 'static,
F: Fn(DefaultMediator) -> H,
pub fn subscribe_deferred<E, H, F>(self, f: F) -> Self where
E: Event + 'static,
H: EventHandler<E> + 'static,
F: Fn(DefaultMediator) -> H,
Registers an event handler using a copy of the mediator.
sourcepub fn subscribe_fn_deferred<E, H, F>(self, f: F) -> Self where
E: Event + 'static,
H: FnMut(E) + 'static,
F: Fn(DefaultMediator) -> H + 'static,
pub fn subscribe_fn_deferred<E, H, F>(self, f: F) -> Self where
E: Event + 'static,
H: FnMut(E) + 'static,
F: Fn(DefaultMediator) -> H + 'static,
Registers an event handler from a function using a copy of the mediator.
sourcepub fn build(self) -> DefaultMediator
pub fn build(self) -> DefaultMediator
Builds a DefaultMediator
.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for DefaultMediatorBuilder
impl Send for DefaultMediatorBuilder
impl Sync for DefaultMediatorBuilder
impl Unpin for DefaultMediatorBuilder
impl UnwindSafe for DefaultMediatorBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more