Skip to main content

ModuleEvent

Enum ModuleEvent 

Source
pub enum ModuleEvent {
    Command(ModuleCommand),
    Clicked(ActivityId),
    Hovered {
        activity: ActivityId,
        hovered: bool,
    },
    Ended {
        activity: ActivityId,
        reason: EndReason,
    },
    BubbleClicked(BubbleId),
    State {
        module: String,
        state: Value,
    },
    Offers(Vec<Contribution>),
}
Expand description

What mochid tells the plugin.

Variants§

§

Command(ModuleCommand)

mochi ipc <plugin> <action>, or a call from another module. Answer it with ModuleCommand::reply or ModuleCommand::answer.

§

Clicked(ActivityId)

A click on one of its activities that has no expanded view.

§

Hovered

The pointer came onto one of its activities on the island, or left.

Fields

§activity: ActivityId

The id ModuleCtx::present returned.

§hovered: bool

Whether the pointer is on it now.

§

Ended

One of its activities is gone for good.

Fields

§activity: ActivityId

The id ModuleCtx::present returned.

§reason: EndReason

Why: it timed out, the user closed it, the plugin withdrew it, another with its key replaced it, or a click outside closed it.

§

BubbleClicked(BubbleId)

A click on one of its bubbles.

§

State

A module from [uses] state in the manifest published state: Value::Null when it stopped. Sent once at the start when it has some, then on every change.

Fields

§module: String

The module’s id.

§state: Value

Its whole state, as it published it.

§

Offers(Vec<Contribution>)

What the enabled modules offer this plugin: every contribution whose target is its id. Sent at the start, then when a reload changes it.

Trait Implementations§

Source§

impl Debug for ModuleEvent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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