pub struct ExecuteResult {
pub execution_count: ExecutionCount,
pub data: Media,
pub metadata: Map<String, Value>,
pub transient: Option<Transient>,
}
Expand description
An execute_result
message on the iopub
channel.
See Execute Result.
The is the “result”, in the REPL sense from execution. As an example, the following Python code:
>>> 3 + 4
7
would have an execute_result
message with the following content:
{
"execution_count": 1,
"data": {
"text/plain": "7"
},
"metadata": {},
"transient": {}
}
Fields§
§execution_count: ExecutionCount
§data: Media
§metadata: Map<String, Value>
§transient: Option<Transient>
Implementations§
Source§impl ExecuteResult
impl ExecuteResult
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 ExecuteResult
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::ExecuteResult;
let parent_message = JupyterMessage::new(jupyter_protocol::UnknownMessage {
msg_type: "example".to_string(),
content: serde_json::json!({ "key": "value" }),
}, None);
let child_message = ExecuteResult{
..Default::default()
}.as_child_of(&parent_message);
// Next you would send the `child_message` over the connection
Source§impl ExecuteResult
impl ExecuteResult
pub fn new(execution_count: ExecutionCount, data: Media) -> Self
Trait Implementations§
Source§impl Clone for ExecuteResult
impl Clone for ExecuteResult
Source§fn clone(&self) -> ExecuteResult
fn clone(&self) -> ExecuteResult
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 ExecuteResult
impl Debug for ExecuteResult
Source§impl Default for ExecuteResult
impl Default for ExecuteResult
Source§impl<'de> Deserialize<'de> for ExecuteResult
impl<'de> Deserialize<'de> for ExecuteResult
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<(ExecutionCount, MediaType)> for ExecuteResult
impl From<(ExecutionCount, MediaType)> for ExecuteResult
Source§fn from((execution_count, content): (ExecutionCount, MediaType)) -> Self
fn from((execution_count, content): (ExecutionCount, MediaType)) -> Self
Converts to this type from the input type.
Source§impl From<(ExecutionCount, Vec<MediaType>)> for ExecuteResult
impl From<(ExecutionCount, Vec<MediaType>)> for ExecuteResult
Source§impl From<ExecuteResult> for JupyterMessage
impl From<ExecuteResult> for JupyterMessage
Source§impl From<ExecuteResult> for JupyterMessageContent
impl From<ExecuteResult> for JupyterMessageContent
Source§fn from(content: ExecuteResult) -> Self
fn from(content: ExecuteResult) -> Self
Create a new JupyterMessageContent
for a ExecuteResult
.
Auto Trait Implementations§
impl Freeze for ExecuteResult
impl RefUnwindSafe for ExecuteResult
impl Send for ExecuteResult
impl Sync for ExecuteResult
impl Unpin for ExecuteResult
impl UnwindSafe for ExecuteResult
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