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: String
The code context in which introspection is requested this may be up to an entire multiline cell.
cursor_pos: usize
The 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};
let message = connection.recv().await?;
let child_message = InspectRequest{
// ...
}.as_child_of(&message);
connection.send(child_message).await?;
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<'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§fn from(content: InspectRequest) -> Self
fn from(content: InspectRequest) -> Self
Create a new JupyterMessage
for a InspectRequest
.
⚠️ If you use this method, you must set the zmq identities yourself. If you have a message that
“caused” your message to be sent, use that message with as_child_of
instead.
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
.