Struct jupyter_client::Client

source ·
pub struct Client { /* private fields */ }
Expand description

The main Client struct.

This handles communication between the user’s code, and the kernel itself. It abstracts the conversion of messages to and from the on-the-wire format.

Construction methods

  • existing: looks for the latest connection file and tries to connect
  • from_reader: reads connection details from a reader

Communication with kernels

Implementations

Connect to the latest existing connection info file.

This searches the standard runtime path for the latest kernel config file by last-modified time. This is then loaded by using from_reader.

let client = Client::existing()?;

Connect to a kernel with a definition from a specific connection info file.

This takes an std::io::Read implementor (e.g. a std::fs::File).

// let file = File::open(...)?;
let client = Client::from_reader(file)?;

Send a shell command to the kernel.

Send a control command to the kernel.

Subscribe to IOPub messages.

Subscribe to heartbeat messages on a given duration.

Subscribe to heartbeat messages every second.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.