Skip to main content

Rig

Trait Rig 

Source
pub trait Rig {
    type Reaction: Reacting;

    // Required methods
    fn bash(&self, at: &Layout) -> String;
    async fn joined(
        &self,
        at: &Layout,
        shell: Arc<Shell>,
    ) -> Result<Self::Reaction, Failure>;
}
Expand description

What bash a rig gives the subject, and how a reaction is made once a shell is there.

A description: &self throughout, because nothing about it changes by running. No method has a default body.

it is handedit produces
&Layout — the workspace, and the files in itSelf::Reaction
Arc<Shell>bash: Bash, options: Options, brought, joined: Stamp

The rig’s bash is laid beside the protocol’s own by the session; stack::with_walk composes it where the rig reports a frame walk.

Required Associated Types§

Source

type Reaction: Reacting

What reacts to one shell.

Required Methods§

Source

fn bash(&self, at: &Layout) -> String

The rig’s own bash: definitions only. Its words, and at most a channel-init function; sourcing it has no effect on a shell beyond names coming into being, so it is inert, re-sourceable, and free of the coordinate unless its author bakes one in.

Source

async fn joined( &self, at: &Layout, shell: Arc<Shell>, ) -> Result<Self::Reaction, Failure>

A shell has joined, and everything about it is known. Awaited in the accept loop, so a slow joined delays the next join and nothing else.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§