Skip to main content

UseEuvBrowser

Struct UseEuvBrowser 

Source
pub struct UseEuvBrowser {
Show 15 fields pub local_key: Signal<String>, pub local_value: Signal<String>, pub local_result: Signal<String>, pub session_key: Signal<String>, pub session_value: Signal<String>, pub session_result: Signal<String>, pub clipboard_text: Signal<String>, pub clipboard_result: Signal<String>, pub window_size: Signal<String>, pub user_agent: Signal<String>, pub language: Signal<String>, pub location_url: Signal<String>, pub location_origin_val: Signal<String>, pub location_pathname_val: Signal<String>, pub console_input: Signal<String>,
}
Expand description

Reactive state for the browser API features.

Aggregates all signals needed for the localStorage, sessionStorage, clipboard, window, navigator, location, and console sections.

Fields§

§local_key: Signal<String>

The localStorage key input.

§local_value: Signal<String>

The localStorage value input.

§local_result: Signal<String>

The localStorage operation result.

§session_key: Signal<String>

The sessionStorage key input.

§session_value: Signal<String>

The sessionStorage value input.

§session_result: Signal<String>

The sessionStorage operation result.

§clipboard_text: Signal<String>

The clipboard text input.

§clipboard_result: Signal<String>

The clipboard operation result.

§window_size: Signal<String>

The window size display.

§user_agent: Signal<String>

The user agent string.

§language: Signal<String>

The navigator language.

§location_url: Signal<String>

The location href.

§location_origin_val: Signal<String>

The location origin.

§location_pathname_val: Signal<String>

The location pathname.

§console_input: Signal<String>

The console message input.

Implementations§

Source§

impl UseEuvBrowser

Implementation of browser API functionality.

Source

pub fn use_browser_state() -> UseEuvBrowser

Creates browser API state for localStorage, sessionStorage, clipboard, and navigator access.

§Returns
  • UseEuvBrowser: The browser API state.
Source

pub fn local_storage_get(key: &str) -> Option<String>

Reads a value from the browser localStorage.

§Arguments
  • &str: The key to look up.
§Returns
  • Option<String>: The stored value if found, or None.
Source

pub fn local_storage_set(key: &str, value: &str)

Writes a key-value pair to the browser localStorage.

§Arguments
  • &str: The key to store.
  • &str: The value to store.
Source

pub fn on_local_storage_set(self) -> Option<Rc<dyn Fn(Event)>>

Creates a click event handler that sets a localStorage item.

§Arguments
  • UseEuvBrowser: The browser API state.
§Returns
  • Option<Rc<dyn Fn(Event)>>: A click handler to set the localStorage item.
Source

pub fn on_local_storage_get(self) -> Option<Rc<dyn Fn(Event)>>

Creates a click event handler that gets a localStorage item.

§Arguments
  • UseEuvBrowser: The browser API state.
§Returns
  • Option<Rc<dyn Fn(Event)>>: A click handler to get the localStorage item.
Source

pub fn on_local_storage_remove(self) -> Option<Rc<dyn Fn(Event)>>

Creates a click event handler that removes a localStorage item.

§Arguments
  • UseEuvBrowser: The browser API state.
§Returns
  • Option<Rc<dyn Fn(Event)>>: A click handler to remove the localStorage item.
Source

pub fn on_session_storage_set(self) -> Option<Rc<dyn Fn(Event)>>

Creates a click event handler that sets a sessionStorage item.

§Arguments
  • UseEuvBrowser: The browser API state.
§Returns
  • Option<Rc<dyn Fn(Event)>>: A click handler to set the sessionStorage item.
Source

pub fn on_session_storage_get(self) -> Option<Rc<dyn Fn(Event)>>

Creates a click event handler that gets a sessionStorage item.

§Arguments
  • UseEuvBrowser: The browser API state.
§Returns
  • Option<Rc<dyn Fn(Event)>>: A click handler to get the sessionStorage item.
Source

pub fn on_session_storage_remove(self) -> Option<Rc<dyn Fn(Event)>>

Creates a click event handler that removes a sessionStorage item.

§Arguments
  • UseEuvBrowser: The browser API state.
§Returns
  • Option<Rc<dyn Fn(Event)>>: A click handler to remove the sessionStorage item.
Source

pub fn on_clipboard_copy(self) -> Option<Rc<dyn Fn(Event)>>

Creates a click event handler that copies text to clipboard.

§Arguments
  • UseEuvBrowser: The browser API state.
§Returns
  • Option<Rc<dyn Fn(Event)>>: A click handler to copy text to clipboard.
Source

pub fn on_clipboard_paste(self) -> Option<Rc<dyn Fn(Event)>>

Creates a click event handler that reads text from clipboard.

§Arguments
  • UseEuvBrowser: The browser API state.
§Returns
  • Option<Rc<dyn Fn(Event)>>: A click handler to read text from clipboard.
Source

pub fn on_window_refresh_size(self) -> Option<Rc<dyn Fn(Event)>>

Creates a click event handler that refreshes the window size display.

§Arguments
  • UseEuvBrowser: The browser API state.
§Returns
  • Option<Rc<dyn Fn(Event)>>: A click handler to refresh the window size.
Source

pub fn on_console_log( console_input: Signal<String>, ) -> Option<Rc<dyn Fn(Event)>>

Creates a click event handler that logs a console message.

§Arguments
  • Signal<String>: The console input signal.
§Returns
  • Option<Rc<dyn Fn(Event)>>: A click handler for console.log.
Source

pub fn on_console_warn( console_input: Signal<String>, ) -> Option<Rc<dyn Fn(Event)>>

Creates a click event handler that warns a console message.

§Arguments
  • Signal<String>: The console input signal.
§Returns
  • Option<Rc<dyn Fn(Event)>>: A click handler for console.warn.
Source

pub fn on_console_error( console_input: Signal<String>, ) -> Option<Rc<dyn Fn(Event)>>

Creates a click event handler that errors a console message.

§Arguments
  • Signal<String>: The console input signal.
§Returns
  • Option<Rc<dyn Fn(Event)>>: A click handler for console.error.
Source§

impl UseEuvBrowser

Source

pub fn get_local_key(&self) -> Signal<String>

Source

pub fn get_mut_local_key(&mut self) -> &mut Signal<String>

Source

pub fn set_local_key(&mut self, val: Signal<String>) -> &mut Self

Source

pub fn get_local_value(&self) -> Signal<String>

Source

pub fn get_mut_local_value(&mut self) -> &mut Signal<String>

Source

pub fn set_local_value(&mut self, val: Signal<String>) -> &mut Self

Source

pub fn get_local_result(&self) -> Signal<String>

Source

pub fn get_mut_local_result(&mut self) -> &mut Signal<String>

Source

pub fn set_local_result(&mut self, val: Signal<String>) -> &mut Self

Source

pub fn get_session_key(&self) -> Signal<String>

Source

pub fn get_mut_session_key(&mut self) -> &mut Signal<String>

Source

pub fn set_session_key(&mut self, val: Signal<String>) -> &mut Self

Source

pub fn get_session_value(&self) -> Signal<String>

Source

pub fn get_mut_session_value(&mut self) -> &mut Signal<String>

Source

pub fn set_session_value(&mut self, val: Signal<String>) -> &mut Self

Source

pub fn get_session_result(&self) -> Signal<String>

Source

pub fn get_mut_session_result(&mut self) -> &mut Signal<String>

Source

pub fn set_session_result(&mut self, val: Signal<String>) -> &mut Self

Source

pub fn get_clipboard_text(&self) -> Signal<String>

Source

pub fn get_mut_clipboard_text(&mut self) -> &mut Signal<String>

Source

pub fn set_clipboard_text(&mut self, val: Signal<String>) -> &mut Self

Source

pub fn get_clipboard_result(&self) -> Signal<String>

Source

pub fn get_mut_clipboard_result(&mut self) -> &mut Signal<String>

Source

pub fn set_clipboard_result(&mut self, val: Signal<String>) -> &mut Self

Source

pub fn get_window_size(&self) -> Signal<String>

Source

pub fn get_mut_window_size(&mut self) -> &mut Signal<String>

Source

pub fn set_window_size(&mut self, val: Signal<String>) -> &mut Self

Source

pub fn get_user_agent(&self) -> Signal<String>

Source

pub fn get_mut_user_agent(&mut self) -> &mut Signal<String>

Source

pub fn set_user_agent(&mut self, val: Signal<String>) -> &mut Self

Source

pub fn get_language(&self) -> Signal<String>

Source

pub fn get_mut_language(&mut self) -> &mut Signal<String>

Source

pub fn set_language(&mut self, val: Signal<String>) -> &mut Self

Source

pub fn get_location_url(&self) -> Signal<String>

Source

pub fn get_mut_location_url(&mut self) -> &mut Signal<String>

Source

pub fn set_location_url(&mut self, val: Signal<String>) -> &mut Self

Source

pub fn get_location_origin_val(&self) -> Signal<String>

Source

pub fn get_mut_location_origin_val(&mut self) -> &mut Signal<String>

Source

pub fn set_location_origin_val(&mut self, val: Signal<String>) -> &mut Self

Source

pub fn get_location_pathname_val(&self) -> Signal<String>

Source

pub fn get_mut_location_pathname_val(&mut self) -> &mut Signal<String>

Source

pub fn set_location_pathname_val(&mut self, val: Signal<String>) -> &mut Self

Source

pub fn get_console_input(&self) -> Signal<String>

Source

pub fn get_mut_console_input(&mut self) -> &mut Signal<String>

Source

pub fn set_console_input(&mut self, val: Signal<String>) -> &mut Self

Trait Implementations§

Source§

impl Clone for UseEuvBrowser

Source§

fn clone(&self) -> UseEuvBrowser

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 Copy for UseEuvBrowser

Source§

impl Debug for UseEuvBrowser

Source§

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

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

impl Default for UseEuvBrowser

Default implementation for UseEuvBrowser.

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for UseEuvBrowser

Source§

impl PartialEq for UseEuvBrowser

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for UseEuvBrowser

Auto Trait Implementations§

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> 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> 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> 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 = 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.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more