pub struct UiMap {
pub id: String,
pub timestamp: DateTime<Utc>,
pub url: String,
pub elements: Vec<UiElement>,
pub text_blocks: Vec<TextBlock>,
pub page_signals: PageSignals,
pub viewport: Viewport,
pub content_hash: String,
pub screenshot_path: String,
}Expand description
Complete UI state representation.
Fields§
§id: String§timestamp: DateTime<Utc>§url: String§elements: Vec<UiElement>§text_blocks: Vec<TextBlock>§page_signals: PageSignals§viewport: Viewport§content_hash: String§screenshot_path: StringImplementations§
Source§impl UiMap
impl UiMap
pub fn new( url: String, elements: Vec<UiElement>, text_blocks: Vec<TextBlock>, page_signals: PageSignals, viewport: Viewport, screenshot_path: String, ) -> Self
pub fn compute_content_hash(&self) -> String
pub fn get_element(&self, element_id: &str) -> Option<&UiElement>
pub fn get_elements_by_role(&self, role: UiRole) -> Vec<&UiElement>
pub fn interactive_elements(&self) -> Vec<&UiElement>
pub fn estimate_tokens(&self, interactive_only: bool) -> usize
pub fn average_confidence(&self) -> f32
Sourcepub fn format_compact(&self) -> String
pub fn format_compact(&self) -> String
Format as compact text for LLM consumption.
Format: [el_0] Button "Submit" (120,340) focused
Trait Implementations§
Source§impl<'de> Deserialize<'de> for UiMap
impl<'de> Deserialize<'de> for UiMap
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 UiMap
impl RefUnwindSafe for UiMap
impl Send for UiMap
impl Sync for UiMap
impl Unpin for UiMap
impl UnsafeUnpin for UiMap
impl UnwindSafe for UiMap
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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