pub struct InterruptRequest {}
Expand description
Request to interrupt the kernel.
This message is used when the kernel’s interrupt_mode
is set to “message”
in its kernelspec. It allows the kernel to be interrupted via a message
instead of an operating system signal.
See https://jupyter-client.readthedocs.io/en/latest/messaging.html#kernel-interrupt
Implementations§
Source§impl InterruptRequest
impl InterruptRequest
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 InterruptRequest
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::InterruptRequest;
let parent_message = JupyterMessage::new(jupyter_protocol::UnknownMessage {
msg_type: "example".to_string(),
content: serde_json::json!({ "key": "value" }),
}, None);
let child_message = InterruptRequest{
..Default::default()
}.as_child_of(&parent_message);
// Next you would send the `child_message` over the connection
Trait Implementations§
Source§impl Clone for InterruptRequest
impl Clone for InterruptRequest
Source§fn clone(&self) -> InterruptRequest
fn clone(&self) -> InterruptRequest
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for InterruptRequest
impl Debug for InterruptRequest
Source§impl Default for InterruptRequest
impl Default for InterruptRequest
Source§fn default() -> InterruptRequest
fn default() -> InterruptRequest
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for InterruptRequest
impl<'de> Deserialize<'de> for InterruptRequest
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<InterruptRequest> for JupyterMessage
impl From<InterruptRequest> for JupyterMessage
Source§impl From<InterruptRequest> for JupyterMessageContent
impl From<InterruptRequest> for JupyterMessageContent
Source§fn from(content: InterruptRequest) -> Self
fn from(content: InterruptRequest) -> Self
Create a new JupyterMessageContent
for a InterruptRequest
.
Auto Trait Implementations§
impl Freeze for InterruptRequest
impl RefUnwindSafe for InterruptRequest
impl Send for InterruptRequest
impl Sync for InterruptRequest
impl Unpin for InterruptRequest
impl UnwindSafe for InterruptRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more