pub struct Plugin<E = (), T = ()> { /* private fields */ }Expand description
A collection of event handlers and an entrypoint that will transform into the root context.
Implementations§
Source§impl Plugin
impl Plugin
pub fn new() -> Self
pub fn event_handler<H, S>(self, handler: H) -> Self
pub fn entrypoint<C, T, E>(self, entrypoint: E) -> Plugin<E, (C, T)>where
E: Entrypoint<C, T>,
Source§impl<E, C, T> Plugin<E, (C, T)>where
E: Entrypoint<C, T>,
impl<E, C, T> Plugin<E, (C, T)>where
E: Entrypoint<C, T>,
pub fn create_root_context(self, context_id: u32) -> Box<dyn RootContext>
Trait Implementations§
Source§impl EventHandlerPush<RequestHeaders> for Plugin
impl EventHandlerPush<RequestHeaders> for Plugin
Source§fn push<H>(&mut self, handler: H)where
H: EventHandler<RequestHeaders> + 'static,
fn push<H>(&mut self, handler: H)where
H: EventHandler<RequestHeaders> + 'static,
Add a handle to the collection.
Source§impl EventHandlerPush<ResponseHeaders> for Plugin
impl EventHandlerPush<ResponseHeaders> for Plugin
Source§fn push<H>(&mut self, handler: H)where
H: EventHandler<ResponseHeaders> + 'static,
fn push<H>(&mut self, handler: H)where
H: EventHandler<ResponseHeaders> + 'static,
Add a handle to the collection.
Auto Trait Implementations§
impl<E, T> Freeze for Plugin<E, T>where
E: Freeze,
impl<E = (), T = ()> !RefUnwindSafe for Plugin<E, T>
impl<E = (), T = ()> !Send for Plugin<E, T>
impl<E = (), T = ()> !Sync for Plugin<E, T>
impl<E, T> Unpin for Plugin<E, T>
impl<E = (), T = ()> !UnwindSafe for Plugin<E, T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more