pub struct MpmConnector { /* private fields */ }Expand description
ServiceConnector for trusty-mpm.
Why: surfaces the running trusty-mpm daemon in the console Overview and
enables the /api/mpm/* route by providing the daemon’s live base URL
via the standard http_addr discovery file (#1849 Phase 1). A backward-compat
fallback reads the TOML lock file for daemons that pre-date the http_addr write.
What: implements detect() using the standard trusty-common data-dir
discovery path (resolve_data_dir("trusty-mpm")/http_addr) as the primary
source and the TOML lock at ~/.trusty-mpm/daemon.lock as a fallback.
Test: unit tests below; run with cargo test -p trusty-console.
Implementations§
Source§impl MpmConnector
impl MpmConnector
Trait Implementations§
Source§impl Default for MpmConnector
impl Default for MpmConnector
Source§impl ServiceConnector for MpmConnector
impl ServiceConnector for MpmConnector
Source§fn detect(&self) -> ServiceInfo
fn detect(&self) -> ServiceInfo
Detect trusty-mpm status, surfacing the daemon URL when reachable.
Why: Phase 1 (#1849) wires trusty-mpm into the console reverse proxy;
the proxy handler resolves the daemon base URL from the connector’s
ServiceInfo.url field, so this method must surface a URL when the
daemon is reachable via the standard http_addr discovery file.
Primary path: binary check → resolve_data_dir("trusty-mpm")/http_addr
(written by the daemon via write_daemon_addr after bind) → TCP probe
→ Running with url: Some(base_url). If the http_addr file is absent
(old daemon that pre-dates #1849), falls back to the TOML lock file and
reports Running without a URL (proxy cannot reach it but the badge is
correct). Binary absent → Absent.
What: delegates to detect_service() for the http_addr path (which adds
the URL and version); the lock-file fallback uses a direct tcp_probe.
Test: mpm_connector_surfaces_url_via_http_addr (primary path),
mpm_connector_parses_lock_addr (fallback path).
Source§fn id(&self) -> &'static str
fn id(&self) -> &'static str
Source§fn display_name(&self) -> &'static str
fn display_name(&self) -> &'static str
Source§fn lifecycle(&self) -> ServiceLifecycle
fn lifecycle(&self) -> ServiceLifecycle
Auto Trait Implementations§
impl Freeze for MpmConnector
impl RefUnwindSafe for MpmConnector
impl Send for MpmConnector
impl Sync for MpmConnector
impl Unpin for MpmConnector
impl UnsafeUnpin for MpmConnector
impl UnwindSafe for MpmConnector
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<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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