Skip to main content

Event

Struct Event 

Source
pub struct Event<'a> { /* private fields */ }
Expand description

The event type.

Implementations§

Source§

impl<'a> Event<'a>

Source

pub fn window(&self) -> Option<Window>

Get the window.

Source

pub fn event_type(&self) -> EventType

Get the event type.

Source

pub fn element(&self) -> String

Get the element.

Source

pub fn event_number(&self) -> usize

Get the event number.

Source

pub fn client_id(&self) -> usize

Get the client ID.

Source

pub fn connection_id(&self) -> usize

Get the connection ID.

Source

pub fn cookies(&self) -> Option<String>

Get the cookies.

Source

pub fn show_client(&self, content: &str) -> Result<(), WebUIError>

Show a window for a specific single client. Useful in multi-client mode to send different content to different connected clients.

Source

pub fn close_client(&self)

Close the connection for a specific single client only, without closing the window for other connected clients.

Source

pub fn navigate_client(&self, url: &str)

Navigate a specific single client to a URL, without affecting other connected clients.

Source

pub fn run_client(&self, script: &str)

Run JavaScript for a specific single client without waiting for a response.

Source

pub fn script_client( &self, script: &str, timeout: usize, capacity: usize, ) -> Result<String, WebUIError>

Run JavaScript for a specific single client and get the response back.

Source

pub fn get_count(&self) -> usize

Get the number of arguments passed to the callback from JavaScript.

Source

pub fn get_int(&self) -> i64

Get the first argument as a 64-bit integer.

Source

pub fn get_int_at(&self, index: usize) -> i64

Get an argument as a 64-bit integer at a specific index.

Source

pub fn get_float(&self) -> f64

Get the first argument as a double-precision float.

Source

pub fn get_float_at(&self, index: usize) -> f64

Get an argument as a double-precision float at a specific index.

Source

pub fn get_string(&self) -> String

Get the first argument as a string slice.

Source

pub fn get_string_at(&self, index: usize) -> String

Get an argument as a string slice at a specific index.

Source

pub fn get_bool(&self) -> bool

Get the first argument as a boolean.

Source

pub fn get_bool_at(&self, index: usize) -> bool

Get an argument as a boolean at a specific index.

Source

pub fn get_size(&self) -> usize

Get the size in bytes of the first argument. Useful for raw binary data.

Source

pub fn get_size_at(&self, index: usize) -> usize

Get the size in bytes of an argument at a specific index.

Source

pub fn return_int(&self, value: i64)

Return a 64-bit integer as the response to a JavaScript await call.

Source

pub fn return_float(&self, value: f64)

Return a double-precision float as the response to a JavaScript await call.

Source

pub fn return_string<S: AsRef<str>>(&self, value: S)

Return a string as the response to a JavaScript await call.

Source

pub fn return_bool(&self, value: bool)

Return a boolean as the response to a JavaScript await call.

Source

pub fn send_raw<T>(&self, function: &str, data: T)
where T: Into<Vec<u8>>,

Send raw binary data to a JavaScript function for a specific single client only.

Auto Trait Implementations§

§

impl<'a> Freeze for Event<'a>

§

impl<'a> RefUnwindSafe for Event<'a>

§

impl<'a> !Send for Event<'a>

§

impl<'a> !Sync for Event<'a>

§

impl<'a> Unpin for Event<'a>

§

impl<'a> UnsafeUnpin for Event<'a>

§

impl<'a> UnwindSafe for Event<'a>

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.