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
Execute a specific command
Fields
silent: boolA 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: boolA 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.
Inspect
Perform introspection into a piece of code.
Fields
code: StringThe code context in which introspection is requested this may be up to an entire multiline cell.
cursor_pos: u64The cursor position within ‘code’ (in unicode characters) where inspection is requested
detail_level: DetailLevelThe 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.
Complete
Ask the kernel to complete the code at the cursor.
Fields
History
Fetch history from the kernel.
Fields
hist_access_type: HistoryAccessTypeSo 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).
IsComplete
Ask the kernel if the current code is complete
Shutdown
Tell the kernel to shutdown.
CommInfo
Fetch comm info.