Trait jupyter::JupyterKernelProtocol
source · pub trait JupyterKernelProtocol: Send + Sync + 'static {
// Required methods
fn language_info(&self) -> LanguageInfo;
fn connected(&mut self, context: JupyterConnection);
fn running(
&mut self,
code: ExecutionRequest
) -> impl Future<Output = ExecutionReply> + Send;
// Provided methods
fn running_time(&self, time: f64) -> String { ... }
fn inspect_variables(
&self,
parent: Option<InspectVariableRequest>
) -> Vec<InspectVariable> { ... }
fn inspect_details(&self, parent: &InspectVariable) -> Box<dyn Executed> { ... }
fn inspect_modules(&self, total: usize) -> Vec<InspectModule> { ... }
fn inspect_sources(&self) -> String { ... }
fn interrupt_kernel(&self) -> Option<String> { ... }
}
Expand description
The protocol of the kernel
Required Methods§
sourcefn language_info(&self) -> LanguageInfo
fn language_info(&self) -> LanguageInfo
Get the language info of the kernel.
sourcefn connected(&mut self, context: JupyterConnection)
fn connected(&mut self, context: JupyterConnection)
Send
sourcefn running(
&mut self,
code: ExecutionRequest
) -> impl Future<Output = ExecutionReply> + Send
fn running( &mut self, code: ExecutionRequest ) -> impl Future<Output = ExecutionReply> + Send
since Generator is not stable, we use sender instead
Generator<Yield = dyn Executed, Return = ExecutionReply>
Provided Methods§
sourcefn running_time(&self, time: f64) -> String
fn running_time(&self, time: f64) -> String
Show the running time of the code.
- unit: seconds
You can suppress statistics by returning String::new()
directly, which will not cause heap allocation.
sourcefn inspect_variables(
&self,
parent: Option<InspectVariableRequest>
) -> Vec<InspectVariable>
fn inspect_variables( &self, parent: Option<InspectVariableRequest> ) -> Vec<InspectVariable>
sourcefn inspect_details(&self, parent: &InspectVariable) -> Box<dyn Executed>
fn inspect_details(&self, parent: &InspectVariable) -> Box<dyn Executed>
View and render an object’s value
sourcefn inspect_modules(&self, total: usize) -> Vec<InspectModule>
fn inspect_modules(&self, total: usize) -> Vec<InspectModule>
Query the currently loaded modules
Arguments
total
: The number of modules to be loaded, 0 means unlimited.
sourcefn inspect_sources(&self) -> String
fn inspect_sources(&self) -> String
Query the currently loaded modules
Arguments
total
: The number of modules to be loaded, 0 means unlimited.
sourcefn interrupt_kernel(&self) -> Option<String>
fn interrupt_kernel(&self) -> Option<String>
Query the currently loaded modules
Arguments
total
: The number of modules to be loaded, 0 means unlimited.
Object Safety§
This trait is not object safe.