pub struct InspectRequest {
    pub code: String,
    pub cursor_pos: usize,
    pub detail_level: Option<usize>,
}Expand description
A inspect_request message on the shell channel.
Code can be inspected to show useful information to the user. It is up to the Kernel to decide what information should be displayed, and its formatting.
Fields§
§code: StringThe code context in which introspection is requested this may be up to an entire multiline cell.
cursor_pos: usizeThe cursor position within ‘code’ (in unicode characters) where inspection is requested
detail_level: Option<usize>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.
Implementations§
Source§impl InspectRequest
 
impl InspectRequest
Sourcepub fn as_child_of(&self, parent: &JupyterMessage) -> JupyterMessage
 
pub fn as_child_of(&self, parent: &JupyterMessage) -> JupyterMessage
Create a new JupyterMessage, assigning the parent for a InspectRequest message.
This method creates a new JupyterMessage with the right content, parent header, and zmq identities, making
it suitable for sending over ZeroMQ.
§Example
use jupyter_protocol::messaging::{JupyterMessage, JupyterMessageContent};
use jupyter_protocol::InspectRequest;
let parent_message = JupyterMessage::new(jupyter_protocol::UnknownMessage {
  msg_type: "example".to_string(),
  content: serde_json::json!({ "key": "value" }),
}, None);
let child_message = InspectRequest{
  ..Default::default()
}.as_child_of(&parent_message);
// Next you would send the `child_message` over the connection
Trait Implementations§
Source§impl Clone for InspectRequest
 
impl Clone for InspectRequest
Source§fn clone(&self) -> InspectRequest
 
fn clone(&self) -> InspectRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for InspectRequest
 
impl Debug for InspectRequest
Source§impl Default for InspectRequest
 
impl Default for InspectRequest
Source§impl<'de> Deserialize<'de> for InspectRequest
 
impl<'de> Deserialize<'de> for InspectRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
    __D: Deserializer<'de>,
 
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
    __D: Deserializer<'de>,
Source§impl From<InspectRequest> for JupyterMessage
 
impl From<InspectRequest> for JupyterMessage
Source§impl From<InspectRequest> for JupyterMessageContent
 
impl From<InspectRequest> for JupyterMessageContent
Source§fn from(content: InspectRequest) -> Self
 
fn from(content: InspectRequest) -> Self
Create a new JupyterMessageContent for a InspectRequest.