Skip to main content

ToPlugin

Enum ToPlugin 

Source
pub enum ToPlugin {
    Hello {
        api: u32,
        version: String,
        module: String,
        settings: Value,
        data_dir: PathBuf,
        session_dir: PathBuf,
        compositor: CompositorState,
    },
    Command {
        id: u64,
        action: String,
        args: Args,
    },
    Clicked {
        activity: u64,
    },
    Hovered {
        activity: u64,
        hovered: bool,
    },
    Ended {
        activity: u64,
        reason: EndReason,
    },
    BubbleClicked {
        bubble: u64,
    },
    State {
        module: String,
        state: Value,
    },
    Compositor {
        state: CompositorState,
    },
    Offers {
        offers: Vec<Contribution>,
    },
    CallResult {
        id: u64,
        error: Option<CallError>,
        output: Option<String>,
    },
    CompositorResult {
        id: u64,
        value: Value,
        error: Option<String>,
    },
}
Expand description

Sent by mochid to a plugin backend.

Variants§

§

Hello

The first message. The backend answers with its own hello.

Fields

§api: u32
§version: String

mochid’s version.

§module: String

The plugin’s id.

§settings: Value

Its [module.<id>] table from config.toml, as JSON.

§data_dir: PathBuf

See ModuleCtx::data_dir.

§session_dir: PathBuf

See ModuleCtx::session_dir.

§compositor: CompositorState
§

Command

Runs one of its actions, with arguments already checked against the manifest. Answer with reply and the same id.

Fields

§id: u64
§action: String
§args: Args
§

Clicked

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

Fields

§activity: u64
§

Hovered

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

Fields

§activity: u64
§hovered: bool
§

Ended

One of its activities is gone for good.

Fields

§activity: u64
§reason: EndReason
§

BubbleClicked

A click on one of its bubbles.

Fields

§bubble: u64
§

State

A module named in the manifest’s [uses] state published state: null when it stopped. Sent once at the start when it has some.

Fields

§module: String
§state: Value
§

Compositor

The compositor’s state changed.

Fields

§

Offers

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

Fields

§

CallResult

The answer to a call.

Fields

§id: u64
§output: Option<String>

What the action answered with, like the output mochi ipc prints.

§

CompositorResult

The answer to a compositor request: windows returns a list of WindowInfo, pointer_output a name or null.

Fields

§id: u64
§value: Value

Trait Implementations§

Source§

impl Clone for ToPlugin

Source§

fn clone(&self) -> ToPlugin

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ToPlugin

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ToPlugin

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for ToPlugin

Source§

fn eq(&self, other: &ToPlugin) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ToPlugin

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ToPlugin

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.