[][src]Struct sauron::Browser

pub struct Browser;

provides an interface for doing url request, such as fetch resize events, keyboard event, timeout event

Implementations

impl Browser[src]

pub fn on_resize<F, APP, MSG>(cb: F) -> Cmd<Program<APP, MSG>> where
    APP: Component<MSG> + 'static,
    F: Fn(i32, i32) -> MSG + Clone + 'static,
    MSG: 'static, 
[src]

Creates a Cmd in which the MSG will be emitted whenever the browser is resized

pub fn on_hashchange<F, APP, MSG>(cb: F) -> Cmd<Program<APP, MSG>> where
    APP: Component<MSG> + 'static,
    F: Fn(String) -> MSG + Clone + 'static,
    MSG: 'static, 
[src]

attached a callback and will be triggered when the hash portion of the window location url is changed

pub fn get_size() -> (i32, i32)[src]

return the size of the browser at this moment

pub fn get_hash() -> String[src]

return the hash part of the browser current url location The hash part are the text right after the # sign

pub fn scroll_to_top()[src]

scroll the browser to the top of the document

Trait Implementations

impl Clone for Browser[src]

impl Copy for Browser[src]

impl Debug for Browser[src]

Auto Trait Implementations

impl RefUnwindSafe for Browser

impl Send for Browser

impl Sync for Browser

impl Unpin for Browser

impl UnwindSafe for Browser

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.