pub struct IrohNativeNode { /* private fields */ }Implementations§
Source§impl IrohNativeNode
impl IrohNativeNode
pub async fn spawn_with_endpoint(endpoint: Endpoint) -> Result<Self>
Sourcepub async fn spawn_with_endpoint_no_router(endpoint: Endpoint) -> Result<Self>
pub async fn spawn_with_endpoint_no_router(endpoint: Endpoint) -> Result<Self>
Spawn a native node wrapper without creating an internal Router accept loop.
This mode is used when the embedding application owns the single iroh
Router and forwards accepted plutonium connections into pluto-rtc via
Client::handle_incoming_connection.
Sourcepub async fn spawn_with_heartbeat(
endpoint: Endpoint,
heartbeat_manager: IrohHeartbeatManager,
heartbeat_health_tx: Sender<HealthTransition>,
heartbeat_config: HeartbeatConfig,
) -> Result<Self>
pub async fn spawn_with_heartbeat( endpoint: Endpoint, heartbeat_manager: IrohHeartbeatManager, heartbeat_health_tx: Sender<HealthTransition>, heartbeat_config: HeartbeatConfig, ) -> Result<Self>
Spawn with an explicit heartbeat manager for iroh-level liveness monitoring.
pub fn endpoint(&self) -> &Endpoint
pub async fn node_addr(&self) -> Result<EndpointAddr>
pub async fn is_connected(&self, endpoint_id: EndpointId) -> bool
pub fn accept_events(&self) -> BoxStream<'static, AcceptEvent>
pub fn connect( &self, endpoint_id: EndpointId, ) -> BoxStream<'static, ConnectEvent>
pub fn connect_addr( &self, endpoint_id: EndpointId, endpoint_addr: EndpointAddr, ) -> BoxStream<'static, ConnectEvent>
Sourcepub fn connect_replacement_addr(
&self,
endpoint_id: EndpointId,
endpoint_addr: EndpointAddr,
replacement_transport_id: u64,
) -> BoxStream<'static, ReplacementEvent>
pub fn connect_replacement_addr( &self, endpoint_id: EndpointId, endpoint_addr: EndpointAddr, replacement_transport_id: u64, ) -> BoxStream<'static, ReplacementEvent>
Establish a fresh Iroh generation through one prepared custom transport. The existing base generation remains available until the replacement is authenticated and the requested custom path is selected.
pub async fn disconnect(&self, endpoint_id: EndpointId) -> Result<()>
pub async fn disconnect_with_reason( &self, endpoint_id: EndpointId, reason: &str, ) -> Result<()>
pub async fn disconnect_with_reason_if_current( &self, endpoint_id: EndpointId, expected_transport_stable_id: u64, reason: &str, ) -> Result<bool>
pub async fn open_bi( &self, endpoint_id: EndpointId, ) -> Result<(SendStream, RecvStream)>
Sourcepub async fn open_bi_with_transport_stable_id(
&self,
endpoint_id: EndpointId,
) -> Result<(u64, SendStream, RecvStream)>
pub async fn open_bi_with_transport_stable_id( &self, endpoint_id: EndpointId, ) -> Result<(u64, SendStream, RecvStream)>
Open a stream and return the physical connection generation that owns
it. Reading the id from the same cloned Connection avoids labeling a
stream with a replacement that raced into the endpoint map.
pub async fn open_uni(&self, endpoint_id: EndpointId) -> Result<SendStream>
Sourcepub async fn probe_connection(
&self,
endpoint_id: EndpointId,
timeout: Duration,
) -> Option<IrohConnectionProbe>
pub async fn probe_connection( &self, endpoint_id: EndpointId, timeout: Duration, ) -> Option<IrohConnectionProbe>
Perform a real remote round-trip on the current physical generation. A replacement that wins during the probe is preserved and checked on the next health pass instead of inheriting the retired leg’s failure.
pub fn incoming_streams_stream(&self) -> Receiver<IncomingStream>
Sourcepub async fn accept_external_connection(
&self,
connection: Connection,
) -> Result<()>
pub async fn accept_external_connection( &self, connection: Connection, ) -> Result<()>
Ingest an already-accepted connection into the pluto-rtc native node’s internal connection/event/stream pipeline.
Sourcepub async fn get_connection(
&self,
endpoint_id: EndpointId,
) -> Option<Connection>
pub async fn get_connection( &self, endpoint_id: EndpointId, ) -> Option<Connection>
Get a raw iroh::Connection for a given EndpointId, if one exists. Used by external protocol handlers (handshake, bucket_sync) to attach application-level logic on top of pluto-rtc-managed connections.
Sourcepub async fn active_endpoint_ids(&self) -> Vec<EndpointId> ⓘ
pub async fn active_endpoint_ids(&self) -> Vec<EndpointId> ⓘ
List all currently active EndpointIds with connections.
pub async fn take_manual_disconnect_notice( &self, endpoint_id: EndpointId, transport_stable_id: u64, ) -> bool
Sourcepub async fn has_manual_disconnect_notice(
&self,
endpoint_id: EndpointId,
transport_stable_id: u64,
) -> bool
pub async fn has_manual_disconnect_notice( &self, endpoint_id: EndpointId, transport_stable_id: u64, ) -> bool
Observe an explicit peer disconnect without consuming the generation- scoped notice. Both the generic physical-close watcher and the incoming-handler lifecycle may observe the same close; only the latter removes the notice after its terminal transition is fenced.