pub struct AgentsConnector { /* private fields */ }Expand description
ServiceConnector for trusty-agents.
Why: surfaces the running trusty-agents API daemon in the console Overview
and enables the /api/agents/* reverse-proxy route by providing the
daemon’s live base URL via the standard http_addr discovery file (#3331).
What: implements detect() using the standard trusty-common data-dir
discovery path (resolve_data_dir("trusty-agents")/http_addr) written by
the daemon on bind. The primary (tagent) binary is the presence gate.
Test: unit tests below; run with cargo test -p trusty-console.
Implementations§
Source§impl AgentsConnector
impl AgentsConnector
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new AgentsConnector.
Why: production callers use new(); there is no home override because
detection reads the OS data dir via resolve_data_dir (overridable in
tests through TRUSTY_DATA_DIR_OVERRIDE).
What: stores no state.
Test: created in all_connectors() and in unit tests.
Trait Implementations§
Source§impl Default for AgentsConnector
impl Default for AgentsConnector
Source§impl ServiceConnector for AgentsConnector
impl ServiceConnector for AgentsConnector
Source§fn detect(&self) -> ServiceInfo
fn detect(&self) -> ServiceInfo
Detect trusty-agents status, surfacing the daemon URL when reachable.
Why: the /api/agents/* proxy handler resolves the daemon base URL from
this connector’s ServiceInfo.url, so detect() must surface a URL when
the daemon is reachable via the standard http_addr discovery file.
What: binary check (tagent) →
resolve_data_dir("trusty-agents")/http_addr → TCP probe → Running
with url: Some(base_url); binary present but no reachable addr file →
Available; binary absent → Absent. Delegates to the shared
detect_service() helper (addr-file read, TCP probe, version fetch).
Test: agents_connector_surfaces_url_via_http_addr (primary path),
agents_connector_no_addr_file, agents_connector_absent_binary.
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 AgentsConnector
impl RefUnwindSafe for AgentsConnector
impl Send for AgentsConnector
impl Sync for AgentsConnector
impl Unpin for AgentsConnector
impl UnsafeUnpin for AgentsConnector
impl UnwindSafe for AgentsConnector
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