jupyter_protocol::connection_info

Struct ConnectionInfo

Source
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.

Source

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

Source

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.

Source

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.

Source

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.

Source

pub fn hb_url(&self) -> String

format the heartbeat url for a ZeroMQ connection Formats the URL for the heartbeat channel.

§Returns

A String containing the formatted URL for the heartbeat channel.

Trait Implementations§

Source§

impl Clone for ConnectionInfo

Source§

fn clone(&self) -> ConnectionInfo

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ConnectionInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ConnectionInfo

Source§

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 PartialEq for ConnectionInfo

Source§

fn eq(&self, other: &ConnectionInfo) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for ConnectionInfo

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ConnectionInfo

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,