Struct sauron::prelude::Http [−][src]
pub struct Http;
Expand description
Provides functions for doing http network request
Implementations
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<Program<APP, MSG>> where
MSG: 'static,
CB: Fn(Result<OUT, Response>) -> MSG + Clone + 'static,
APP: Component<MSG> + 'static,
DE: Fn(String) -> OUT + Clone + 'static,
ERRCB: Fn(TypeError) -> MSG + Clone + 'static,
OUT: 'static,
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<Program<APP, MSG>> where
MSG: 'static,
CB: Fn(Result<OUT, Response>) -> MSG + Clone + 'static,
APP: Component<MSG> + 'static,
DE: Fn(String) -> OUT + Clone + 'static,
ERRCB: Fn(TypeError) -> MSG + Clone + 'static,
OUT: 'static,
fetch text document from the url and decode the result with the supplied response_text_decoder function
API for fetching http rest request
pub fn fetch_with_request_and_response_decoder<APP, MSG, DECODE, ERR>(
url: &str,
request_init: Option<RequestInit>,
text_response_decoder: DECODE,
err_cb: ERR
) -> Cmd<Program<APP, MSG>> where
MSG: 'static,
APP: Component<MSG> + 'static,
DECODE: Fn((u16, String, Headers)) -> MSG + 'static,
ERR: Fn(TypeError) -> MSG + 'static,
pub fn fetch_with_request_and_response_decoder<APP, MSG, DECODE, ERR>(
url: &str,
request_init: Option<RequestInit>,
text_response_decoder: DECODE,
err_cb: ERR
) -> Cmd<Program<APP, MSG>> where
MSG: 'static,
APP: Component<MSG> + 'static,
DECODE: Fn((u16, String, Headers)) -> MSG + 'static,
ERR: Fn(TypeError) -> MSG + 'static,
API for fetching http rest request err_cb - request failed, in cases where a network is down, server is dead, etc.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Http
impl UnwindSafe for Http
Blanket Implementations
Mutably borrows from an owned value. Read more