pub struct Event<'a> { /* private fields */ }Expand description
The event type.
Implementations§
Source§impl<'a> Event<'a>
impl<'a> Event<'a>
Sourcepub fn event_type(&self) -> EventType
pub fn event_type(&self) -> EventType
Get the event type.
Sourcepub fn event_number(&self) -> usize
pub fn event_number(&self) -> usize
Get the event number.
Sourcepub fn connection_id(&self) -> usize
pub fn connection_id(&self) -> usize
Get the connection ID.
Get the cookies.
Sourcepub fn show_client(&self, content: &str) -> Result<(), WebUIError>
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.
Sourcepub fn close_client(&self)
pub fn close_client(&self)
Close the connection for a specific single client only, without closing the window for other connected clients.
Navigate a specific single client to a URL, without affecting other connected clients.
Sourcepub fn run_client(&self, script: &str)
pub fn run_client(&self, script: &str)
Run JavaScript for a specific single client without waiting for a response.
Sourcepub fn script_client(
&self,
script: &str,
timeout: usize,
capacity: usize,
) -> Result<String, WebUIError>
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.
Sourcepub fn get_count(&self) -> usize
pub fn get_count(&self) -> usize
Get the number of arguments passed to the callback from JavaScript.
Sourcepub fn get_int_at(&self, index: usize) -> i64
pub fn get_int_at(&self, index: usize) -> i64
Get an argument as a 64-bit integer at a specific index.
Sourcepub fn get_float_at(&self, index: usize) -> f64
pub fn get_float_at(&self, index: usize) -> f64
Get an argument as a double-precision float at a specific index.
Sourcepub fn get_string(&self) -> String
pub fn get_string(&self) -> String
Get the first argument as a string slice.
Sourcepub fn get_string_at(&self, index: usize) -> String
pub fn get_string_at(&self, index: usize) -> String
Get an argument as a string slice at a specific index.
Sourcepub fn get_bool_at(&self, index: usize) -> bool
pub fn get_bool_at(&self, index: usize) -> bool
Get an argument as a boolean at a specific index.
Sourcepub fn get_size(&self) -> usize
pub fn get_size(&self) -> usize
Get the size in bytes of the first argument. Useful for raw binary data.
Sourcepub fn get_size_at(&self, index: usize) -> usize
pub fn get_size_at(&self, index: usize) -> usize
Get the size in bytes of an argument at a specific index.
Sourcepub fn return_int(&self, value: i64)
pub fn return_int(&self, value: i64)
Return a 64-bit integer as the response to a JavaScript await call.
Sourcepub fn return_float(&self, value: f64)
pub fn return_float(&self, value: f64)
Return a double-precision float as the response to a JavaScript await call.
Sourcepub fn return_string<S: AsRef<str>>(&self, value: S)
pub fn return_string<S: AsRef<str>>(&self, value: S)
Return a string as the response to a JavaScript await call.
Sourcepub fn return_bool(&self, value: bool)
pub fn return_bool(&self, value: bool)
Return a boolean as the response to a JavaScript await call.