pub(crate) struct AgentProbe {
pub block: Box<dyn Fn() -> Option<String> + Send>,
pub hidden: Box<dyn Fn(&str) -> bool + Send>,
pub status: Box<dyn Fn(&str) -> Option<AgentStatus> + Send>,
pub provider: Box<dyn Fn(&str) -> String + Send>,
pub identity: Box<dyn Fn() -> Value + Send>,
pub pending: Box<dyn Fn(&str) -> PendingFacts + Send>,
}Expand description
What a feed asks about its agent while it runs: the block it runs in now,
whether it has been hidden from paired devices, its state, and the
provider of a block it moves to, who it is for each snapshot, and what
waits in it (its controller’s pending_for_devices).
Fields§
§block: Box<dyn Fn() -> Option<String> + Send>§status: Box<dyn Fn(&str) -> Option<AgentStatus> + Send>§provider: Box<dyn Fn(&str) -> String + Send>§identity: Box<dyn Fn() -> Value + Send>§pending: Box<dyn Fn(&str) -> PendingFacts + Send>Implementations§
Source§impl AgentProbe
impl AgentProbe
Sourcepub(crate) fn of(state: &AppState, name: &str) -> Self
pub(crate) fn of(state: &AppState, name: &str) -> Self
The agent registered as name: its block from the registry (it moves
on a respawn), hidden per its definition, its state from the tracker
the LAN feed uses (agent_state::agent_status_of_block), the
provider per the block’s meta, and who it is per identity_of.
Sourcepub(crate) fn for_device(self, state: &AppState, device_id: &str) -> Self
pub(crate) fn for_device(self, state: &AppState, device_id: &str) -> Self
The same probe for device_id’s feed: the agent also counts as hidden once the device is no longer let in
(a computer, after its host’s person stopped allowing computers), so the feed ends at its next event or
heartbeat, as it does when the agent is hidden.
Auto Trait Implementations§
impl !RefUnwindSafe for AgentProbe
impl !Sync for AgentProbe
impl !UnwindSafe for AgentProbe
impl Freeze for AgentProbe
impl Send for AgentProbe
impl Unpin for AgentProbe
impl UnsafeUnpin for AgentProbe
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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