pub enum ViewInput {
Navigate {
url: String,
},
Click {
x: f64,
y: f64,
},
Type {
text: String,
},
Keypress {
key: String,
modifiers: Vec<Modifier>,
},
Scroll {
delta_y: i32,
},
Paste {
text: String,
},
Back,
Forward,
Reload,
TabOpen,
TabClose {
tab_id: String,
},
TabSwitch {
tab_id: String,
},
}Expand description
One user-driven input, as a view hands it to whatever browser backs it.
The whole surface a person has: navigate/click/type/keypress/scroll/paste,
the three nav-bar history buttons, and the three tab operations. NO perception
of any kind — nothing here returns page content, which is what keeps this
surface from being a browsing path around the full_access browse_*
tools.
Variants§
Click
Type
Keypress
Scroll
Paste
Paste at the caret, replacing the selection. Carries the TEXT because the clipboard belongs to the host’s OS, not to the page: CDP’s injected key events cannot reach a clipboard, so a synthesised ⌘V delivers a key event and nothing arrives. The host reads its own pasteboard and sends the string.
Back
The nav bar’s Back / Forward / Reload buttons. Real history moves through CDP, not synthesised ⌘←/⌘→ keystrokes — those are browser chrome the input domain never reaches, so they inject into the PAGE and the history never moves.
Forward
Reload
TabOpen
TabClose
TabSwitch
Implementations§
Source§impl ViewInput
impl ViewInput
Sourcepub async fn apply(self, tools: &BrowserTools) -> Result<Option<String>, String>
pub async fn apply(self, tools: &BrowserTools) -> Result<Option<String>, String>
Execute this input against a browser in THIS process. Ok(Some(id)) is
the newly opened tab’s id; every other input answers Ok(None).
Shared by the in-daemon path and the supervised agent process’s
agent.browser.input handler for the same reason ViewControl::apply
is: the drawer must behave identically whichever process the browser
happens to live in, and error strings included, that is only guaranteed
if it is literally the same code.
Trait Implementations§
impl StructuralPartialEq for ViewInput
Auto Trait Implementations§
impl Freeze for ViewInput
impl RefUnwindSafe for ViewInput
impl Send for ViewInput
impl Sync for ViewInput
impl Unpin for ViewInput
impl UnsafeUnpin for ViewInput
impl UnwindSafe for ViewInput
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<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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