pub struct AdminState { /* private fields */ }Expand description
Shared state for admin RPC handlers.
Implementations§
Source§impl AdminState
impl AdminState
Sourcepub const fn new(
node_id: [u8; 32],
started_at: Instant,
cache: CacheEngine,
reload_hook: Option<ReloadHook>,
drain_trigger: Arc<DrainTrigger>,
metrics: Arc<Metrics>,
) -> Self
pub const fn new( node_id: [u8; 32], started_at: Instant, cache: CacheEngine, reload_hook: Option<ReloadHook>, drain_trigger: Arc<DrainTrigger>, metrics: Arc<Metrics>, ) -> Self
Assemble the admin surface’s view of the running node. reload_hook
is None when the daemon started with no config path, which is what
makes reload unavailable rather than merely inert.
Sourcepub const fn with_binding(self, binding: BindingReport) -> Self
pub const fn with_binding(self, binding: BindingReport) -> Self
Attach the bring-up node-id binding check so admin_v1_health can
report whether this node’s key is the one bound on-chain (#1034). The
production runtime calls this once after new; without it, health
reports BindingStatus::Unknown, which means “not checked” rather
than “fine”.
Sourcepub fn with_staker_set(self, staker_set: Arc<dyn StakerSet>) -> Self
pub fn with_staker_set(self, staker_set: Arc<dyn StakerSet>) -> Self
Attach the live active-staker set so admin_v1_health can report
whether this node is registered on-chain (#1030). The production runtime
calls this once after new with the SAME Arc DHT admission holds. Not
const: unlike Self::with_binding’s Copy report, assigning over an
Option<Arc<_>> runs a destructor.
Sourcepub fn with_dht(self, dht: DhtStatusHandles) -> Self
pub fn with_dht(self, dht: DhtStatusHandles) -> Self
Attach DHT introspection handles so admin_v1_status can report
routing-table health (issue #741). The production runtime calls
this once after new; without it, status returns
DHT_UNAVAILABLE_CODE.
Sourcepub fn with_lanes(self, lanes: LaneStatusHandles) -> Self
pub fn with_lanes(self, lanes: LaneStatusHandles) -> Self
Attach lane introspection handles so admin_v1_lanes can report
lane state (issue #749). The production runtime calls this once
after new; without it, lanes returns an empty list with the
default-zero threshold.
Sourcepub fn with_buyer_pools(self, buyer_pools: Arc<dyn BuyerPoolStore>) -> Self
pub fn with_buyer_pools(self, buyer_pools: Arc<dyn BuyerPoolStore>) -> Self
Attach the buyer pool store so admin_v1_pools can report this node’s
buyer-side PaymentPool state (#2078). The production runtime calls
this once after new with the SAME handle BuyerPoolService writes
through, unconditionally; without it, pools returns
BUYER_POOL_UNAVAILABLE_CODE.
Sourcepub fn with_slash_detection(self, slash_detection: SlashStatusHandles) -> Self
pub fn with_slash_detection(self, slash_detection: SlashStatusHandles) -> Self
Attach slash-detection handles so admin_v1_slashes can report slashes
against this node’s operator (#1032). The production runtime calls this
once after new when a slash_judge_address is configured; without it,
slashes returns SLASH_DETECTION_UNAVAILABLE_CODE.
Sourcepub fn with_warming(self, warming: Arc<WarmingAllowance>) -> Self
pub fn with_warming(self, warming: Arc<WarmingAllowance>) -> Self
Attach the shared ADR 041 warming allowance so admin_v1_evict can
forget an evicted hash’s source_of provenance tag (issue #1751
review). The production runtime calls this once after new with the
SAME Arc the buy loop, the eviction driver, and the warming-credit
aggregator share; without it, an admin evict leaves the tag in place.
Sourcepub fn with_denylist(self, denylist: Arc<ContentDenylist>) -> Self
pub fn with_denylist(self, denylist: Arc<ContentDenylist>) -> Self
Attach the live content denylist so admin_v1_status can report the
current on-chain origin deny-set size (chain_denied_origins). The
production runtime calls this once after new with the SAME Arc the
client handler and blacklist watcher hold; without it, status
reports 0.
Sourcepub const fn with_operator_address(self, operator_address: Address) -> Self
pub const fn with_operator_address(self, operator_address: Address) -> Self
Attach the operator Ethereum address so admin_v1_status can report the
wallet this node runs under. The production runtime calls this once after
new with the loaded eth signer’s address (the same value the bring-up
binding check derives); without it, status reports
operator_address: None.
Trait Implementations§
Source§impl Clone for AdminState
impl Clone for AdminState
Auto Trait Implementations§
impl !RefUnwindSafe for AdminState
impl !UnwindSafe for AdminState
impl Freeze for AdminState
impl Send for AdminState
impl Sync for AdminState
impl Unpin for AdminState
impl UnsafeUnpin for AdminState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request