Skip to main content

AdminRpcImpl

Struct AdminRpcImpl 

Source
pub struct AdminRpcImpl { /* private fields */ }
Expand description

Concrete server implementation backed by the live AdminState.

Implementations§

Source§

impl AdminRpcImpl

Source

pub const fn new(state: AdminState) -> Self

Serve the admin RPC methods against state.

Trait Implementations§

Source§

impl AdminRpcServer for AdminRpcImpl

Source§

fn health<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RpcResult<HealthResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return this node’s identity and process uptime.
Source§

fn evict<'life0, 'async_trait>( &'life0 self, req: EvictRequest, ) -> Pin<Box<dyn Future<Output = RpcResult<EvictResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Evict a single blob from the local cache (issue #279). The eviction is logical: the iroh-blobs store still holds the bytes (Blobs::delete is pub(crate) in iroh-blobs and reserved for the GC task) until the next periodic GC sweep reclaims them (#518). The takedown itself is persisted to <cache_dir>/evicted.log so it survives a restart even when the next sweep hasn’t run yet. Read more
Source§

fn reload<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RpcResult<ReloadResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Re-read the config file the node was started with and apply the reloadable subset (issue #373) — the same path SIGHUP triggers, exposed over the loopback admin surface for operators who want scripted control without kill -HUP. Both paths share the same RuntimeReloadState::reload, whose internal mutexes serialise concurrent reloads, so a SIGHUP racing this RPC waits behind it rather than corrupting state. Returns: Read more
Source§

fn drain<'life0, 'async_trait>( &'life0 self, req: DrainRequest, ) -> Pin<Box<dyn Future<Output = RpcResult<DrainResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Trigger graceful shutdown via the same path SIGTERM exercises (issue #244, appendix-local-admin-http.md). Stops the iroh router’s accept loop and awaits in-flight ProtocolHandler::shutdown calls; the subsequent task drain is bounded by the runtime’s 15s SHUTDOWN_DEADLINE (the router-shutdown step itself is unbounded — a stuck handler hangs the runtime, only the post-router task join is timeout-gated). Read more
Source§

fn status<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RpcResult<StatusResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return a snapshot of this node’s DHT participation health (issue #741): routing-table bucket fill rates, the network-wide last bucket-refresh timestamp, active-staker count, provider-record store utilization, and republish-scheduler depth. Intended for decdn node status, giving operators a single human-readable (or --json) view to diagnose cold-start or routing-table degradation without scraping Prometheus. Returns DHT_UNAVAILABLE_CODE when the DHT subsystem is not wired on this node.
Source§

fn lanes<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RpcResult<LanesResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return a live snapshot of every lane this node provides against a PaymentPool (issue #749): per lane the outstanding accrued claim, time since the last voucher (in-memory, None after a restart until the next voucher), and whether the accrued claim has reached the redemption threshold. Backs decdn node lanes, giving operators a single view to spot lanes approaching settlement, stale lanes, or unusually high outstanding balances before they become a liquidity risk — without scraping metrics or logs. Returns POOL_STORE_ERROR_CODE if the pool state store cannot be read.
Source§

fn slashes<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RpcResult<SlashesResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return every slash the node’s watcher has detected against its own operator (#1032, G-NODE-05): per slash the slashId, offense type, amount, evidence digest, block, and the 30-day appeal-window close time. Consumed directly by operators/keepers (no CLI subcommand wraps it) so they notice a slash and file decdn appeal slash in time. Returns SLASH_DETECTION_UNAVAILABLE_CODE when the slash watcher is not wired on this node.
Source§

fn pools<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RpcResult<BuyerPoolsResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return the node’s buyer-side PaymentPool state: every pool its buyer leg tracks, the deposit it believes each holds, and the per-lane spend watermark it has signed against each provider. Read more
Source§

fn into_rpc(self) -> RpcModule<Self>

Collects all the methods and subscriptions defined in the trait and adds them into a single RpcModule.
Source§

impl Clone for AdminRpcImpl

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for AdminRpcImpl

Source§

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

Formats the value using the given formatter. Read more

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, dest: *mut u8)

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self> ⓘ

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

Source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> MaybeSend for T
where T: Send,

Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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 = !

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

fn try_from(value: U) -> Result<T, !>

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more