pub struct CommClose {
pub comm_id: CommId,
pub data: Map<String, Value>,
}
Expand description
A comm_close
message on the iopub
channel.
Since comms live on both sides, when a comm is destroyed the other side must be notified. This is done with a comm_close message.
Fields§
§comm_id: CommId
§data: Map<String, Value>
Implementations§
Source§impl CommClose
impl CommClose
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 CommClose
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::CommClose;
let parent_message = JupyterMessage::new(jupyter_protocol::UnknownMessage {
msg_type: "example".to_string(),
content: serde_json::json!({ "key": "value" }),
}, None);
let child_message = CommClose{
..Default::default()
}.as_child_of(&parent_message);
// Next you would send the `child_message` over the connection
Trait Implementations§
Source§impl<'de> Deserialize<'de> for CommClose
impl<'de> Deserialize<'de> for CommClose
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<CommClose> for JupyterMessage
impl From<CommClose> for JupyterMessage
Source§impl From<CommClose> for JupyterMessageContent
impl From<CommClose> for JupyterMessageContent
Auto Trait Implementations§
impl Freeze for CommClose
impl RefUnwindSafe for CommClose
impl Send for CommClose
impl Sync for CommClose
impl Unpin for CommClose
impl UnwindSafe for CommClose
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