pub struct ClearOutput {
pub wait: bool,
}
Expand description
Clear output of a single cell / output area.
Fields§
§wait: bool
Wait to clear the output until new output is available. Clears the existing output immediately before the new output is displayed. Useful for creating simple animations with minimal flickering.
Implementations§
Source§impl ClearOutput
impl ClearOutput
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 ClearOutput
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::ClearOutput;
let parent_message = JupyterMessage::new(jupyter_protocol::UnknownMessage {
msg_type: "example".to_string(),
content: serde_json::json!({ "key": "value" }),
}, None);
let child_message = ClearOutput{
..Default::default()
}.as_child_of(&parent_message);
// Next you would send the `child_message` over the connection
Trait Implementations§
Source§impl Clone for ClearOutput
impl Clone for ClearOutput
Source§fn clone(&self) -> ClearOutput
fn clone(&self) -> ClearOutput
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 ClearOutput
impl Debug for ClearOutput
Source§impl Default for ClearOutput
impl Default for ClearOutput
Source§fn default() -> ClearOutput
fn default() -> ClearOutput
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ClearOutput
impl<'de> Deserialize<'de> for ClearOutput
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<ClearOutput> for JupyterMessage
impl From<ClearOutput> for JupyterMessage
Source§impl From<ClearOutput> for JupyterMessageContent
impl From<ClearOutput> for JupyterMessageContent
Source§fn from(content: ClearOutput) -> Self
fn from(content: ClearOutput) -> Self
Create a new JupyterMessageContent
for a ClearOutput
.
Auto Trait Implementations§
impl Freeze for ClearOutput
impl RefUnwindSafe for ClearOutput
impl Send for ClearOutput
impl Sync for ClearOutput
impl Unpin for ClearOutput
impl UnwindSafe for ClearOutput
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