pub struct ReviewConnector { /* private fields */ }Expand description
ServiceConnector for trusty-review.
Why: the console dashboard’s Review tab still needs to say whether review is
usable on this machine. Since #6290 that question is “is the binary there
and does it run”, not “is a daemon up”.
What: implements detect() — binary on PATH, then one --version spawn.
Test: see the module docs.
Implementations§
Source§impl ReviewConnector
impl ReviewConnector
Sourcepub fn with_binary(binary: impl Into<String>) -> Self
pub fn with_binary(binary: impl Into<String>) -> Self
Create a connector that probes binary instead of trusty-review.
Why: the absent-binary verdict is otherwise unreachable on a developer
machine, which has trusty-review installed. Overriding the NAME keeps
the test free of environment variables — five sibling connectors run in
the same pass and share this process’s PATH.
What: stores binary for use by detect().
Test: review_connector_reports_absent_when_the_binary_is_missing.
Trait Implementations§
Source§impl Default for ReviewConnector
impl Default for ReviewConnector
Source§impl ServiceConnector for ReviewConnector
impl ServiceConnector for ReviewConnector
Source§fn detect(&self) -> ServiceInfo
fn detect(&self) -> ServiceInfo
Detect trusty-review status.
Why: tctl asks the same question for a different reason, and the two
must agree — since #6290 both ask it by presence
(trusty_installer::commands::probe_http::probe_presence), not by
dialling.
What: not on PATH → Absent. On PATH but not runnable → Degraded with
the reason as its hint, matching tctl’s ProbeFailed for the same
host. Otherwise Available carrying whatever --version printed. url
is None: there is no address, and ADR-0032 makes trusty-console the
only HTTP surface in the workspace, so a synthesised one would be a link
that cannot work. Every verdict carries
ServiceLifecycle::OnDemand so the
card stops offering to start a daemon that does not exist (#6416).
Test: see the module docs;
helpers::tests::a_binary_that_cannot_execute_is_not_available.
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 ReviewConnector
impl RefUnwindSafe for ReviewConnector
impl Send for ReviewConnector
impl Sync for ReviewConnector
impl Unpin for ReviewConnector
impl UnsafeUnpin for ReviewConnector
impl UnwindSafe for ReviewConnector
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