pub struct MemoryConnector { /* private fields */ }Expand description
ServiceConnector for trusty-memory.
Why: the console’s dashboard needs to know whether the analyzer daemon is
running, and since #6286 that question is answered by dialling its socket.
What: implements detect() — binary on PATH, then one memory.health call.
Test: see the module docs.
Implementations§
Source§impl MemoryConnector
impl MemoryConnector
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: memory_connector_reports_available_when_nothing_is_serving.
Trait Implementations§
Source§impl Default for MemoryConnector
impl Default for MemoryConnector
Source§impl ServiceConnector for MemoryConnector
impl ServiceConnector for MemoryConnector
Source§fn detect(&self) -> ServiceInfo
fn detect(&self) -> ServiceInfo
Detect trusty-memory 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 (#6286).
What: binary check → memory.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. A socket path that
cannot be resolved reports Available with the reason in hint — see
MemoryConnector::socket_path.
Test: memory_connector_reports_available_when_nothing_is_serving,
memory_connector_reads_the_version_off_a_live_socket,
memory_connector_surfaces_an_unresolvable_socket_path_as_a_hint,
memory_connector_reports_degraded_when_the_daemon_answers_with_an_error.
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 MemoryConnector
impl RefUnwindSafe for MemoryConnector
impl Send for MemoryConnector
impl Sync for MemoryConnector
impl Unpin for MemoryConnector
impl UnsafeUnpin for MemoryConnector
impl UnwindSafe for MemoryConnector
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