pub struct DashboardIpcService { /* private fields */ }Expand description
Target-side dashboard IPC service.
Implementations§
Source§impl DashboardIpcService
impl DashboardIpcService
Sourcepub fn new(
config: ValidatedDashboardIpcConfig,
spec: SupervisorSpec,
state: SupervisorState,
journal: EventJournal,
) -> Self
pub fn new( config: ValidatedDashboardIpcConfig, spec: SupervisorSpec, state: SupervisorState, journal: EventJournal, ) -> Self
Creates a dashboard IPC service.
§Arguments
config: Validated target-side IPC configuration.spec: Supervisor declaration used for topology state.state: Current supervisor state.journal: Recent event journal.
§Returns
Returns a DashboardIpcService without a control handle.
Sourcepub fn with_handle(self, handle: SupervisorHandle) -> Self
pub fn with_handle(self, handle: SupervisorHandle) -> Self
Sourcepub fn with_security_pipeline(self, pipeline: IpcSecurityPipeline) -> Self
pub fn with_security_pipeline(self, pipeline: IpcSecurityPipeline) -> Self
Sourcepub fn max_frame_bytes(&self) -> usize
pub fn max_frame_bytes(&self) -> usize
Returns the effective maximum frame size in bytes for the frame reader.
When a security pipeline is configured with C5 request size limit
enabled, returns the configured max_bytes. Otherwise falls back
to DEFAULT_MAX_FRAME_BYTES (1 MiB).
This ensures the frame reader rejects oversized frames before JSON deserialization, fulfilling C5’s contract.
Sourcepub fn registration_payload(
&self,
) -> Result<TargetProcessRegistration, DashboardError>
pub fn registration_payload( &self, ) -> Result<TargetProcessRegistration, DashboardError>
Sourcepub async fn handle_request(
&self,
request: IpcRequest,
peer: &PeerIdentity,
connection_id: &str,
raw_body_len: usize,
) -> IpcResponse
pub async fn handle_request( &self, request: IpcRequest, peer: &PeerIdentity, connection_id: &str, raw_body_len: usize, ) -> IpcResponse
Handles one parsed IPC request with connection context.
Runs IPC security checks before dispatching when a security pipeline is configured.
Control point ordering:
- C6 (rate limit) → C5 (size limit) → C2 (peer credentials) → C3
(authorization) — via
check. - C8 (idempotency) checked before C4 (replay) — if a cached response exists for the request_id, it is returned immediately without recording in the replay window. This prevents C4 from rejecting a legitimate retry that carries the same request_id.
- C4 (replay protection) — records the request_id only after confirming C8 had no cached result.
- Dispatch → C8 cache result → C7 (audit, post-dispatch).
High-risk commands fail closed on audit write failure: when the
audit backend is unwritable and the failure strategy is
fail_closed, a denial response is returned instead of the normal
dispatch result.
§Arguments
request: Parsed IPC request.peer: Real peer identity extracted from the connected socket.connection_id: Unique identifier for this connection.raw_body_len: Byte length of the raw request body.
§Returns
Returns a response that preserves the request identifier.
Sourcepub async fn current_dashboard_state(
&self,
) -> Result<DashboardState, DashboardError>
pub async fn current_dashboard_state( &self, ) -> Result<DashboardState, DashboardError>
Builds the current dashboard state.
The state_generation in the returned state reflects the current
serial number of the runtime — it is incremented only when runtime
state actually transitions (child exits, restarts, control commands).
Pure read operations do not bump this counter, so dashboard clients
can reliably detect genuine state changes for cache invalidation.
§Arguments
This function has no arguments.
§Returns
Returns the current DashboardState.
Auto Trait Implementations§
impl !Freeze for DashboardIpcService
impl !RefUnwindSafe for DashboardIpcService
impl !UnwindSafe for DashboardIpcService
impl Send for DashboardIpcService
impl Sync for DashboardIpcService
impl Unpin for DashboardIpcService
impl UnsafeUnpin for DashboardIpcService
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> 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> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi Quirk value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);