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§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ConnectionInfo
impl Debug for ConnectionInfo
Source§impl<'de> Deserialize<'de> for ConnectionInfo
impl<'de> Deserialize<'de> for ConnectionInfo
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>,
Source§impl PartialEq for ConnectionInfo
impl PartialEq for ConnectionInfo
Source§impl Serialize for ConnectionInfo
impl Serialize for ConnectionInfo
impl StructuralPartialEq for ConnectionInfo
Auto Trait Implementations§
impl Freeze for ConnectionInfo
impl RefUnwindSafe for ConnectionInfo
impl Send for ConnectionInfo
impl Sync for ConnectionInfo
impl Unpin for ConnectionInfo
impl UnwindSafe for ConnectionInfo
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)