Struct hc_sleuth::context_log::Context
source · pub struct Context {
pub facts: HashSet<Event>,
pub map_node_to_agents: HashMap<SleuthId, HashSet<AgentPubKey>>,
pub map_agent_to_node: HashMap<AgentPubKey, SleuthId>,
pub map_op_to_sysval_dep_hashes: HashMap<OpRef, Vec<ActionHash>>,
pub map_op_to_appval_dep_hash: HashMap<OpRef, HashSet<AnyDhtHash>>,
pub map_dep_hash_to_op: HashMap<AnyDhtHash, OpRef>,
pub map_action_to_op: HashMap<ChainOpAction, OpRef>,
pub op_info: HashMap<OpRef, OpInfo>,
}
Fields§
§facts: HashSet<Event>
All facts ever recorded
map_node_to_agents: HashMap<SleuthId, HashSet<AgentPubKey>>
Track which agents are part of which nodes
map_agent_to_node: HashMap<AgentPubKey, SleuthId>
Track which node an agent is part of
map_op_to_sysval_dep_hashes: HashMap<OpRef, Vec<ActionHash>>
Track the sys validation deps for an op hash
map_op_to_appval_dep_hash: HashMap<OpRef, HashSet<AnyDhtHash>>
Track the app validation deps for an op hash
map_dep_hash_to_op: HashMap<AnyDhtHash, OpRef>
Track which op a dependency is part of
map_action_to_op: HashMap<ChainOpAction, OpRef>
Map the (action hash + op type) representation to the actual op hash
op_info: HashMap<OpRef, OpInfo>
The full info associated with each op hash
Implementations§
source§impl Context
impl Context
pub fn from_file(r: impl BufRead) -> Self
pub fn check(&self, fact: &Event) -> bool
pub fn node_agents(&self, id: &SleuthId) -> ContextResult<&HashSet<AgentPubKey>>
pub fn agent_node(&self, agent: &AgentPubKey) -> ContextResult<&SleuthId>
sourcepub fn sysval_op_deps(&self, op: &OpRef) -> ContextResult<Vec<&OpInfo>>
pub fn sysval_op_deps(&self, op: &OpRef) -> ContextResult<Vec<&OpInfo>>
Get the sys validation dependency of this op hash if applicable
sourcepub fn appval_op_deps(&self, op: &OpRef) -> ContextResult<HashSet<&OpInfo>>
pub fn appval_op_deps(&self, op: &OpRef) -> ContextResult<HashSet<&OpInfo>>
Get the app validation dependencies of this op hash
pub fn op_info(&self, op: &OpRef) -> ContextResult<&OpInfo>
pub fn op_from_action( &self, action: ActionHash, op_type: ChainOpType, ) -> ContextResult<OpRef>
pub fn as_if(&mut self)
pub fn all_events_for_topic()
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Context
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
Blanket Implementations§
source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Mutably borrows from an owned value. Read more
source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> 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>
Converts
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>
Converts
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 moresource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.
source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.source§impl<T> Upcastable for T
impl<T> Upcastable for T
source§fn upcast_any_ref(&self) -> &(dyn Any + 'static)
fn upcast_any_ref(&self) -> &(dyn Any + 'static)
upcast ref
source§fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
upcast mut ref