pub struct ConnectionInfo {
pub ip: String,
pub transport: Transport,
pub shell_port: u16,
pub iopub_port: u16,
pub stdin_port: u16,
pub control_port: u16,
pub hb_port: u16,
pub key: String,
pub signature_scheme: String,
pub kernel_name: Option<String>,
}Expand description
Represents the runtime connection information for a Jupyter kernel.
This struct contains all the necessary information for a Jupyter client to connect to a kernel, including ports, transport protocol, and authentication details.
§Fields
ip- The IP address of the kernel.transport- The transport protocol (TCP or IPC).shell_port- The port number for the shell channel.iopub_port- The port number for the IOPub channel.stdin_port- The port number for the stdin channel.control_port- The port number for the control channel.hb_port- The port number for the heartbeat channel.key- The authentication key.signature_scheme- The signature scheme used for message authentication.kernel_name- An optional name for the kernel.
§Example
use jupyter_protocol::connection_info::{ConnectionInfo, Transport};
let info = ConnectionInfo {
ip: "127.0.0.1".to_string(),
transport: Transport::TCP,
shell_port: 6767,
iopub_port: 6768,
stdin_port: 6790,
control_port: 6791,
hb_port: 6792,
key: "secret_key".to_string(),
signature_scheme: "hmac-sha256".to_string(),
kernel_name: Some("python3".to_string()),
};
assert_eq!(info.shell_url(), "tcp://127.0.0.1:6767");Fields§
§ip: String§transport: Transport§shell_port: u16§iopub_port: u16§stdin_port: u16§control_port: u16§hb_port: u16§key: String§signature_scheme: String§kernel_name: Option<String>Implementations§
Source§impl ConnectionInfo
Provides methods to generate formatted URLs for various Jupyter communication channels.
impl ConnectionInfo
Provides methods to generate formatted URLs for various Jupyter communication channels.
Sourcepub fn iopub_url(&self) -> String
pub fn iopub_url(&self) -> String
Formats the URL for the IOPub channel.
§Returns
A String containing the formatted URL for the IOPub channel.
format the iopub url for a ZeroMQ connection
Sourcepub fn shell_url(&self) -> String
pub fn shell_url(&self) -> String
format the shell url for a ZeroMQ connection Formats the URL for the shell channel.
§Returns
A String containing the formatted URL for the shell channel.
Sourcepub fn stdin_url(&self) -> String
pub fn stdin_url(&self) -> String
format the stdin url for a ZeroMQ connection Formats the URL for the stdin channel.
§Returns
A String containing the formatted URL for the stdin channel.
Sourcepub fn control_url(&self) -> String
pub fn control_url(&self) -> String
format the control url for a ZeroMQ connection Formats the URL for the control channel.
§Returns
A String containing the formatted URL for the control channel.
Trait Implementations§
Source§impl Clone for ConnectionInfo
impl Clone for ConnectionInfo
Source§fn clone(&self) -> ConnectionInfo
fn clone(&self) -> ConnectionInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more