pub struct SearchConnector { /* private fields */ }Expand description
ServiceConnector for trusty-search.
Why: the dashboard needs to know whether the search daemon is running, and
since #6285 that question is answered by dialling its socket.
What: implements detect() — binary on PATH, then one search.health call.
Test: see the module docs.
Implementations§
Source§impl SearchConnector
impl SearchConnector
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.
Test: search_connector_reports_available_when_nothing_is_serving.
Trait Implementations§
Source§impl Default for SearchConnector
impl Default for SearchConnector
Source§impl ServiceConnector for SearchConnector
impl ServiceConnector for SearchConnector
Source§fn detect(&self) -> ServiceInfo
fn detect(&self) -> ServiceInfo
Detect trusty-search status.
Why: the dashboard needs to know whether the daemon is up, and tctl’s
probe asks the same question — so the two must agree, which they do by
dialling the same method on the same derived path (#6285).
What: binary check → search.health over the socket → status. 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. The dashboard reaches
the daemon’s own UI at /tools/search/ instead (#6155).
Test: see the module docs.
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 SearchConnector
impl RefUnwindSafe for SearchConnector
impl Send for SearchConnector
impl Sync for SearchConnector
impl Unpin for SearchConnector
impl UnsafeUnpin for SearchConnector
impl UnwindSafe for SearchConnector
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