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, ReplacementConnectEvent>
pub fn connect_replacement_addr( &self, endpoint_id: EndpointId, endpoint_addr: EndpointAddr, replacement_transport_id: u64, ) -> BoxStream<'static, ReplacementConnectEvent>
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.
Trait Implementations§
Source§impl Clone for IrohNativeNode
impl Clone for IrohNativeNode
Source§fn clone(&self) -> IrohNativeNode
fn clone(&self) -> IrohNativeNode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for IrohNativeNode
impl !Unpin for IrohNativeNode
impl !UnsafeUnpin for IrohNativeNode
impl !UnwindSafe for IrohNativeNode
impl Freeze for IrohNativeNode
impl Send for IrohNativeNode
impl Sync for IrohNativeNode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more