[][src]Struct sauron_core::dom::Http

pub struct Http;

Provides functions for doing http network request

Implementations

impl Http[src]

pub fn fetch_with_text_response_decoder<APP, MSG, DE, CB, ERRCB, OUT>(
    url: &str,
    response_text_decoder: DE,
    cb: CB,
    err_cb: ERRCB
) -> Cmd<APP, MSG> where
    CB: Fn(Result<OUT, Response>) -> MSG + Clone + 'static,
    ERRCB: Fn(TypeError) -> MSG + Clone + 'static,
    DE: Fn(String) -> OUT + Clone + 'static,
    OUT: 'static,
    APP: Component<MSG> + 'static,
    MSG: 'static, 
[src]

fetch text document from the url and decode the result with the supplied response_text_decoder function

pub fn fetch_with_response_decoder<APP, MSG, SUCCEED, FAIL, ERR>(
    url: &str,
    success_text_decoder: SUCCEED,
    fail_cb: FAIL,
    err_cb: ERR
) -> Cmd<APP, MSG> where
    APP: Component<MSG> + 'static,
    MSG: 'static,
    SUCCEED: Fn((String, Headers)) -> MSG + 'static,
    FAIL: Fn(Response) -> MSG + 'static,
    ERR: Fn(TypeError) -> MSG + 'static, 
[src]

API for fetching http rest request

pub fn fetch_with_request_and_response_decoder<APP, MSG, SUCCEED, FAIL, ERR>(
    url: &str,
    request_init: Option<RequestInit>,
    success_text_decoder: SUCCEED,
    fail_cb: FAIL,
    err_cb: ERR
) -> Cmd<APP, MSG> where
    APP: Component<MSG> + 'static,
    MSG: 'static,
    SUCCEED: Fn((String, Headers)) -> MSG + 'static,
    FAIL: Fn(Response) -> MSG + 'static,
    ERR: Fn(TypeError) -> MSG + 'static, 
[src]

API for fetching http rest request

Trait Implementations

impl Clone for Http[src]

impl Copy for Http[src]

impl Debug for Http[src]

Auto Trait Implementations

impl RefUnwindSafe for Http

impl Send for Http

impl Sync for Http

impl Unpin for Http

impl UnwindSafe for Http

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.