Plugin

Struct Plugin 

Source
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

Source

pub fn new() -> Self

Source

pub fn event_handler<H, S>(self, handler: H) -> Self
where S: Event, H: EventHandler<S> + 'static, Self: EventHandlerPush<S>,

Source

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>,

Source

pub fn create_root_context(self, context_id: u32) -> Box<dyn RootContext>

Trait Implementations§

Source§

impl<E: Default, T: Default> Default for Plugin<E, T>

Source§

fn default() -> Plugin<E, T>

Returns the “default value” for a type. Read more
Source§

impl EventHandlerPush<RequestHeaders> for Plugin

Source§

fn push<H>(&mut self, handler: H)
where H: EventHandler<RequestHeaders> + 'static,

Add a handle to the collection.
Source§

impl EventHandlerPush<ResponseHeaders> for Plugin

Source§

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>
where E: Unpin, T: Unpin,

§

impl<E = (), T = ()> !UnwindSafe for Plugin<E, T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<C, T> Extract<T> for C
where T: FromContext<C>,

Source§

type Error = <T as FromContext<C>>::Error

Source§

fn extract(&self) -> Result<T, <C as Extract<T>>::Error>

Source§

fn extract_always(&self) -> T
where Self: Extract<T, Error = Infallible>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.