pub struct Plugins<G: Html> {
    pub functional_actions: FunctionalPluginActions<G>,
    pub control_actions: ControlPluginActions,
    /* private fields */
}
Expand description

A representation of all the plugins used by an app. Due to the sheer number and compexity of nested fields, this is best transferred in an Rc, which unfortunately results in double indirection for runner functions.

Fields

functional_actions: FunctionalPluginActions<G>

The functional actions that this plugin takes. This is defined by default such that all actions are assigned to a default, and so they can all be run without long chains of matching Option<T>s.

control_actions: ControlPluginActions

The control actions that this plugin takes. This is defined by default such that all actions are assigned to a default, and so they can all be run without long chains of matching Option<T>s.

Implementations

Creates a new instance of Plugins, with no actions taken by any plugins, and the data map empty.

Registers a new plugin, consuming self. For control actions, this will check if a plugin has already registered on an action, and throw an error if one has, noting the conflict explicitly in the error message. This can only register plugins that run exclusively on the server-side (including tinker-time and the build process).

The same as .plugin(), but registers a plugin that can run on the client-side. This is deliberately separated out to make conditional compilation feasible and to emphasize to users what’s incrasing their bundle sizes. Note that this should also be used for plugins that run on both the client and server.

Gets a reference to the map of plugin data. Note that each element of plugin data is additionally Boxed.

Trait Implementations

Formats the value using the given formatter. Read more

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

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.