pub struct AnalyzeConnector { /* private fields */ }Expand description
ServiceConnector for trusty-analyze.
Why: the console’s dashboard needs to know whether the analyzer daemon is
running, and since #6287 that question is answered by dialling its socket.
What: implements detect() — binary on PATH, then one analyze.health call.
Test: see the module docs.
Implementations§
Source§impl AnalyzeConnector
impl AnalyzeConnector
Sourcepub fn with_socket(socket: PathBuf) -> Self
pub fn with_socket(socket: PathBuf) -> Self
Create a connector that dials socket instead of the resolved path.
Why: unit tests must not dial the real user’s running daemon, and the
integration test needs to point this at a socket it bound itself.
Test: analyze_connector_reports_available_when_nothing_is_serving.
Trait Implementations§
Source§impl Default for AnalyzeConnector
impl Default for AnalyzeConnector
Source§impl ServiceConnector for AnalyzeConnector
impl ServiceConnector for AnalyzeConnector
Source§fn detect(&self) -> ServiceInfo
fn detect(&self) -> ServiceInfo
Detect trusty-analyze status.
Why: the console dashboard needs to know whether the daemon is up, and
tctl makes the same call for a different reason — so the two must
agree, which they do by dialling the same method on the same derived
path (#6287).
What: binary check → analyze.health over the socket → status, falling
back to trusty-analyze --version when nothing answers. url is
deliberately None: a UDS daemon has no URL, and ADR-0032 makes
trusty-console the only HTTP surface in the workspace, so a synthesised
http:// address would be a link that cannot work. A socket path that
cannot be resolved reports Available with the reason in hint — see
AnalyzeConnector::socket_path.
Test: analyze_connector_reports_available_when_nothing_is_serving,
analyze_connector_reads_the_version_off_a_live_socket,
analyze_connector_surfaces_an_unresolvable_socket_path_as_a_hint.
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 AnalyzeConnector
impl RefUnwindSafe for AnalyzeConnector
impl Send for AnalyzeConnector
impl Sync for AnalyzeConnector
impl Unpin for AnalyzeConnector
impl UnsafeUnpin for AnalyzeConnector
impl UnwindSafe for AnalyzeConnector
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