pub struct ShutdownRequest {
pub restart: bool,
}
Expand description
Request to shut down the kernel.
Upon receiving this message, the kernel will send a reply and then shut itself down.
If restart
is True, the kernel will restart itself after shutting down.
See https://jupyter-client.readthedocs.io/en/latest/messaging.html#kernel-shutdown
Fields§
§restart: bool
Implementations§
Source§impl ShutdownRequest
impl ShutdownRequest
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 ShutdownRequest
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::ShutdownRequest;
let parent_message = JupyterMessage::new(jupyter_protocol::UnknownMessage {
msg_type: "example".to_string(),
content: serde_json::json!({ "key": "value" }),
}, None);
let child_message = ShutdownRequest{
..Default::default()
}.as_child_of(&parent_message);
// Next you would send the `child_message` over the connection
Trait Implementations§
Source§impl Clone for ShutdownRequest
impl Clone for ShutdownRequest
Source§fn clone(&self) -> ShutdownRequest
fn clone(&self) -> ShutdownRequest
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 ShutdownRequest
impl Debug for ShutdownRequest
Source§impl Default for ShutdownRequest
impl Default for ShutdownRequest
Source§fn default() -> ShutdownRequest
fn default() -> ShutdownRequest
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ShutdownRequest
impl<'de> Deserialize<'de> for ShutdownRequest
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<ShutdownRequest> for JupyterMessage
impl From<ShutdownRequest> for JupyterMessage
Source§impl From<ShutdownRequest> for JupyterMessageContent
impl From<ShutdownRequest> for JupyterMessageContent
Source§fn from(content: ShutdownRequest) -> Self
fn from(content: ShutdownRequest) -> Self
Create a new JupyterMessageContent
for a ShutdownRequest
.
Auto Trait Implementations§
impl Freeze for ShutdownRequest
impl RefUnwindSafe for ShutdownRequest
impl Send for ShutdownRequest
impl Sync for ShutdownRequest
impl Unpin for ShutdownRequest
impl UnwindSafe for ShutdownRequest
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