pub struct SemanticObservation {
pub schema_version: u32,
pub revision: u64,
pub level: SemanticObservationLevel,
pub route: SemanticRouteIdentity,
pub page: SemanticPage,
pub regions: Vec<SemanticRegion>,
pub text: Option<String>,
pub accessibility: Option<Vec<SemanticAccessibilityNode>>,
pub raw_accessibility: Option<Vec<SemanticAccessibilityNode>>,
pub changes: Option<SemanticChangeSet>,
pub limits: SemanticObservationLimits,
}Expand description
Versioned semantic page model.
Fields§
§schema_version: u32§revision: u64§level: SemanticObservationLevel§route: SemanticRouteIdentity§page: SemanticPage§regions: Vec<SemanticRegion>§text: Option<String>§accessibility: Option<Vec<SemanticAccessibilityNode>>§raw_accessibility: Option<Vec<SemanticAccessibilityNode>>§changes: Option<SemanticChangeSet>§limits: SemanticObservationLimitsImplementations§
Source§impl SemanticObservation
impl SemanticObservation
Sourcepub fn from_page_context(
context: &PageContext,
level: SemanticObservationLevel,
) -> Result<Self, SemanticObservationError>
pub fn from_page_context( context: &PageContext, level: SemanticObservationLevel, ) -> Result<Self, SemanticObservationError>
Build a deterministic semantic summary from an existing fresh page observation. Classification is advisory and never replaces revisioned interactive references from the source observation.
Sourcepub fn scoped_region_from_page_context(
context: &PageContext,
level: SemanticObservationLevel,
region_id: &str,
) -> Result<Self, SemanticObservationError>
pub fn scoped_region_from_page_context( context: &PageContext, level: SemanticObservationLevel, region_id: &str, ) -> Result<Self, SemanticObservationError>
Build a revision-scoped observation containing one previously named region. The source context is still classified in full so the region ID and its target grouping follow the same deterministic rules as the page-level observation.
Sourcepub fn diff_from(
&self,
previous: &SemanticObservation,
) -> Result<SemanticChangeSet, SemanticObservationError>
pub fn diff_from( &self, previous: &SemanticObservation, ) -> Result<SemanticChangeSet, SemanticObservationError>
Compute bounded changes from an earlier compatible observation.
Sourcepub fn with_changes_from(
self,
previous: &SemanticObservation,
) -> Result<Self, SemanticObservationError>
pub fn with_changes_from( self, previous: &SemanticObservation, ) -> Result<Self, SemanticObservationError>
Attach a revision-aware diff to this observation.
Sourcepub fn validate(&self) -> Result<(), SemanticObservationError>
pub fn validate(&self) -> Result<(), SemanticObservationError>
Validate bounds and cross-field identity invariants.
Sourcepub fn from_json(input: &str) -> Result<Self, SemanticObservationError>
pub fn from_json(input: &str) -> Result<Self, SemanticObservationError>
Parse and validate a semantic observation from JSON.
Sourcepub fn to_canonical_json(&self) -> Result<String, SemanticObservationError>
pub fn to_canonical_json(&self) -> Result<String, SemanticObservationError>
Serialize a validated observation deterministically.
Trait Implementations§
Source§impl Clone for SemanticObservation
impl Clone for SemanticObservation
Source§fn clone(&self) -> SemanticObservation
fn clone(&self) -> SemanticObservation
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SemanticObservation
impl Debug for SemanticObservation
Source§impl<'de> Deserialize<'de> for SemanticObservation
impl<'de> Deserialize<'de> for SemanticObservation
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SemanticObservation
impl RefUnwindSafe for SemanticObservation
impl Send for SemanticObservation
impl Sync for SemanticObservation
impl Unpin for SemanticObservation
impl UnsafeUnpin for SemanticObservation
impl UnwindSafe for SemanticObservation
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
Mutably borrows from an owned value. Read more
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>,
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 more