pub enum Command {
    KernelInfo,
    Execute {
        code: String,
        silent: bool,
        store_history: bool,
        user_expressions: HashMap<String, String>,
        allow_stdin: bool,
        stop_on_error: bool,
    },
    Inspect {
        code: String,
        cursor_pos: u64,
        detail_level: DetailLevel,
    },
    Complete {
        code: String,
        cursor_pos: u64,
    },
    History {
        output: bool,
        raw: bool,
        hist_access_type: HistoryAccessType,
        unique: bool,
    },
    IsComplete {
        code: String,
    },
    Shutdown {
        restart: bool,
    },
    CommInfo {
        target_name: Option<String>,
    },
}
Expand description

Available commands.

Variants

KernelInfo

Ask for information about the running kernel

Execute

Fields

code: String

Source code to be executed by the kernel, one or more lines.

silent: bool

A boolean flag which, if true, signals the kernel to execute this code as quietly as possible. silent=true forces store_history to be false, and will not: - broadcast output on the IOPub channel - have an execute_result The default is false.

store_history: bool

A boolean flag which, if true, signals the kernel to populate history The default is true if silent is false. If silent is true, store_history is forced to be false.

user_expressions: HashMap<String, String>

A HashMap mapping names to expressions to be evaluated in the user’s HashMap. The rich display-data representation of each will be evaluated after execution. See the display_data content for the structure of the representation data.

allow_stdin: bool

Some frontends do not support stdin requests. If this is true, code running in the kernel can prompt the user for input with an input_request message. If it is false, the kernel should not send these messages.

stop_on_error: bool

A boolean flag, which, if true, does not abort the execution queue, if an exception * is encountered. This allows the queued execution of multiple execute_requests, even if they generate exceptions.

Execute a specific command

Inspect

Fields

code: String

The code context in which introspection is requested this may be up to an entire multiline cell.

cursor_pos: u64

The cursor position within ‘code’ (in unicode characters) where inspection is requested

detail_level: DetailLevel

The level of detail desired. In IPython, the default (0) is equivalent to typing ‘x?’ at the prompt, 1 is equivalent to ‘x??’. The difference is up to kernels, but in IPython level 1 includes the source code if available.

Perform introspection into a piece of code.

Complete

Fields

code: String

The code context in which completion is requested this may be up to an entire multiline cell, such as ‘foo = a.isal’

cursor_pos: u64

The cursor position within ‘code’ (in unicode characters) where completion is requested

Ask the kernel to complete the code at the cursor.

History

Fields

output: bool

If True, also return output history in the resulting dict.

raw: bool

If True, return the raw input history, else the transformed input.

hist_access_type: HistoryAccessType

So far, this can be range, tail or search. If hist_access_type is range, get a range of input cells. session is a number counting up each time the kernel starts; you can give a positive session number, or a negative number to count back from the current session. start and stop are line (cell) numbers within that session. If hist_access_type is ‘tail’ or ‘search’, get the last n cells. If hist_access_type is ‘search’, get cells matching the specified glob pattern (with * and ? as wildcards).

unique: bool

If hist_access_type is ‘search’ and unique is true, do not include duplicated history. Default is false.

Fetch history from the kernel.

IsComplete

Fields

code: String

The code entered so far as a multiline string

Ask the kernel if the current code is complete

Shutdown

Fields

restart: bool

False if final shutdown, or True if shutdown precedes a restart

Tell the kernel to shutdown.

CommInfo

Fields

target_name: Option<String>

The target name

Fetch comm info.

Trait Implementations

Formats the value using the given formatter. Read more
Serialize this value into the given Serde serializer. 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.

Should always be Self
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.