Skip to main content

TargetEvidence

Struct TargetEvidence 

Source
pub struct TargetEvidence {
Show 15 fields pub platform: String, pub app_id: String, pub pid: Option<u32>, pub window_id: Option<Value>, pub window_title_digest: Option<String>, pub display_id: Option<String>, pub role: Option<String>, pub label_digest: Option<String>, pub bounds: Option<Bounds>, pub observation_id: String, pub screenshot_hash: Option<String>, pub device_pixel_ratio: Option<f64>, pub ui_tree_revision: Option<String>, pub confidence: f64, pub captured_at: String,
}
Expand description

Evidence binding an action to a fresh desktop observation.

Fields§

§platform: String

Platform identifier for the observed target (e.g. darwin, windows).

§app_id: String

Application/bundle identifier of the observed target.

§pid: Option<u32>

Process identifier of the observed target, when known.

§window_id: Option<Value>

Platform-specific window identifier, when known.

§window_title_digest: Option<String>

Digest of the window title (never the raw title).

§display_id: Option<String>

Display identifier hosting the target, when known.

§role: Option<String>

Accessibility role of the target element, when known.

§label_digest: Option<String>

Digest of the element label (never the raw label).

§bounds: Option<Bounds>

Bounding box of the target element, when known.

§observation_id: String

Identifier of the observation frame this evidence came from.

§screenshot_hash: Option<String>

Hash of the screenshot backing this observation, when captured.

§device_pixel_ratio: Option<f64>

Pixels per logical point of the screenshot screenshot_hash names: 2.0 for a 3024×1964 screenshot of a 1512×982-point display.

§ui_tree_revision: Option<String>

Revision of the UI tree backing this observation, when captured.

§confidence: f64

Observation confidence in 0.0..=1.0.

§captured_at: String

RFC 3339 timestamp of the observation.

Implementations§

Source§

impl TargetEvidence

Source

pub fn check_screen_binding(&self) -> Result<(), String>

Checks that the evidence binds its bounds to its screenshot (spec 3.7 V-I14): a target with both bounds and a screenshot hash states the screenshot’s device pixel ratio, the bounds carry the same ratio, and the box is finite and not inverted.

§Errors

Returns a message naming the violated rule.

§Example
use adk_computer_use::{Bounds, TargetEvidence};

let mut target = TargetEvidence {
    platform: "darwin".into(),
    app_id: "com.example.crm".into(),
    pid: None,
    window_id: None,
    window_title_digest: None,
    display_id: Some("built-in".into()),
    role: None,
    label_digest: None,
    bounds: Some(Bounds::points(960.0, 590.0, 90.0, 40.0, 2.0)),
    observation_id: "observation-1".into(),
    screenshot_hash: Some("sha256:ab12".into()),
    device_pixel_ratio: Some(2.0),
    ui_tree_revision: None,
    confidence: 0.9,
    captured_at: "2026-11-22T10:00:00Z".into(),
};
assert!(target.check_screen_binding().is_ok());
target.device_pixel_ratio = None;
assert!(target.check_screen_binding().is_err());

Trait Implementations§

Source§

impl Clone for TargetEvidence

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TargetEvidence

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for TargetEvidence

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for TargetEvidence

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for TargetEvidence

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for TargetEvidence

Auto Trait Implementations§

§

impl Forget for TargetEvidence

§

impl Freeze for TargetEvidence
where *const u8 is !null: Freeze, PhantomData<u8>: Freeze, PhantomData<Value>: Freeze, *const LeafNode<String, Value> is !null: Freeze, PhantomData<(Owned, LeafOrInternal)>: Freeze, PhantomData<Box<(String, Value)>>: Freeze,

§

impl Move for TargetEvidence

§

impl RefUnwindSafe for TargetEvidence

§

impl Send for TargetEvidence
where RawVecInner: Send, NodeRef<Owned, String, Value, LeafOrInternal>: Send, BoxRaw<(String, Value)>: Send,

§

impl Sync for TargetEvidence
where RawVecInner: Sync, NodeRef<Owned, String, Value, LeafOrInternal>: Sync, BoxRaw<(String, Value)>: Sync,

§

impl Unpin for TargetEvidence
where *const u8 is !null: Unpin, *const LeafNode<String, Value> is !null: Unpin, Box<(String, Value)>: Unpin,

§

impl UnsafeUnpin for TargetEvidence

§

impl UnwindSafe for TargetEvidence
where RawVecInner: UnwindSafe, BTreeMap<String, Value>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more