Struct sauron_core::dom::Http
source · [−]pub struct Http;
Expand description
Provides functions for doing http network request
Implementations
sourceimpl Http
impl Http
sourcepub fn fetch_with_text_response_decoder<APP, MSG, SUCCESS, ERROR>(
url: &str,
fetch_cb: SUCCESS,
error_cb: ERROR
) -> Cmd<APP, MSG> where
SUCCESS: Fn(String) -> MSG + Clone + 'static,
ERROR: Fn(TypeError) -> MSG + Clone + 'static,
APP: Application<MSG> + 'static,
MSG: 'static,
pub fn fetch_with_text_response_decoder<APP, MSG, SUCCESS, ERROR>(
url: &str,
fetch_cb: SUCCESS,
error_cb: ERROR
) -> Cmd<APP, MSG> where
SUCCESS: Fn(String) -> MSG + Clone + 'static,
ERROR: Fn(TypeError) -> MSG + Clone + 'static,
APP: Application<MSG> + 'static,
MSG: 'static,
fetch text document from the url and decode the result with the supplied response_text_decoder function
sourcepub fn fetch_with_request_and_response_decoder<APP, MSG, DECODER, ERROR>(
url: &str,
request_init: Option<RequestInit>,
decoder_dispatcher: DECODER,
error_cb: ERROR
) -> Cmd<APP, MSG> where
APP: Application<MSG> + 'static,
MSG: 'static,
DECODER: Fn((Response, Program<APP, MSG>)) + 'static,
ERROR: Fn(TypeError) -> MSG + 'static,
pub fn fetch_with_request_and_response_decoder<APP, MSG, DECODER, ERROR>(
url: &str,
request_init: Option<RequestInit>,
decoder_dispatcher: DECODER,
error_cb: ERROR
) -> Cmd<APP, MSG> where
APP: Application<MSG> + 'static,
MSG: 'static,
DECODER: Fn((Response, Program<APP, MSG>)) + 'static,
ERROR: Fn(TypeError) -> MSG + 'static,
API for fetching http rest request error_cb - request failed, in cases where a network is down, server is dead, etc.
Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more