pub struct Finding {
pub id: String,
pub entity: Option<Value>,
pub ontology: Option<FindingOntologyRef>,
pub extra: Map<String, Value>,
}Expand description
One finding, as written by rht’s dimension-analyst agents.
Fields§
§id: StringThe finding’s unique identifier.
entity: Option<Value>The typed entity payload, if this finding declares one. Validated against its resolved entity type’s schema.
ontology: Option<FindingOntologyRef>An explicit ontology reference, disambiguating which ontology’s entity type this finding intends when more than one bound ontology declares the same type name.
extra: Map<String, Value>Every other top-level field (e.g. content), scanned for discovery
pattern matches when no explicit typing is present.
Implementations§
Source§impl Finding
impl Finding
Sourcepub fn load(path: &Path) -> Result<Self, MifRhError>
pub fn load(path: &Path) -> Result<Self, MifRhError>
Reads and parses a finding file.
§Errors
Returns MifRhError::FindingIo if path cannot be read, or
MifRhError::FindingJson if it is not valid JSON.
Sourcepub fn entity_type(&self) -> Option<&str>
pub fn entity_type(&self) -> Option<&str>
The finding’s declared entity.entity_type, if any, treating an
empty string the same as absent.
Sourcepub const fn has_typing_intent(&self) -> bool
pub const fn has_typing_intent(&self) -> bool
Whether this finding carries typing intent: an entity block or an
explicit ontology.id reference. When false, classification falls
back to discovery-pattern matching.
Sourcepub fn discovery_text(&self) -> String
pub fn discovery_text(&self) -> String
The concatenation of every top-level, non-@-prefixed string field
(typically just content), for discovery-pattern matching. Matches
rht’s own resolve-ontology.sh, which joins the finding’s top-level
string fields with spaces before testing each discovery pattern.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Finding
impl<'de> Deserialize<'de> for Finding
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Finding
impl RefUnwindSafe for Finding
impl Send for Finding
impl Sync for Finding
impl Unpin for Finding
impl UnsafeUnpin for Finding
impl UnwindSafe for Finding
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
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