pub enum HistoryRequest {
Range {
session: Option<i32>,
start: i32,
stop: i32,
output: bool,
raw: bool,
},
Tail {
n: i32,
output: bool,
raw: bool,
},
Search {
pattern: String,
unique: bool,
output: bool,
raw: bool,
},
}
Variants§
Implementations§
Source§impl HistoryRequest
impl HistoryRequest
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 HistoryRequest
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::HistoryRequest;
let parent_message = JupyterMessage::new(jupyter_protocol::UnknownMessage {
msg_type: "example".to_string(),
content: serde_json::json!({ "key": "value" }),
}, None);
let child_message = HistoryRequest::Range {
session: None,
start: 0,
stop: 10,
output: false,
raw: false,
}.as_child_of(&parent_message);
// Next you would send the `child_message` over the connection
Trait Implementations§
Source§impl Clone for HistoryRequest
impl Clone for HistoryRequest
Source§fn clone(&self) -> HistoryRequest
fn clone(&self) -> HistoryRequest
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 HistoryRequest
impl Debug for HistoryRequest
Source§impl Default for HistoryRequest
impl Default for HistoryRequest
Source§impl<'de> Deserialize<'de> for HistoryRequest
impl<'de> Deserialize<'de> for HistoryRequest
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<HistoryRequest> for JupyterMessage
impl From<HistoryRequest> for JupyterMessage
Source§impl From<HistoryRequest> for JupyterMessageContent
impl From<HistoryRequest> for JupyterMessageContent
Source§fn from(content: HistoryRequest) -> Self
fn from(content: HistoryRequest) -> Self
Create a new JupyterMessageContent
for a HistoryRequest
.
Auto Trait Implementations§
impl Freeze for HistoryRequest
impl RefUnwindSafe for HistoryRequest
impl Send for HistoryRequest
impl Sync for HistoryRequest
impl Unpin for HistoryRequest
impl UnwindSafe for HistoryRequest
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