pub struct Http { /* private fields */ }Expand description
A GET request, from cx.http_get(url). It is a Copy handle, like a
signal, and goes with the context that asked.
Implementations§
Source§impl Http
impl Http
Sourcepub fn body(&self) -> ReadSignal<Option<String>>
pub fn body(&self) -> ReadSignal<Option<String>>
The last body that arrived whole, kept through a later fetch that
fails. None until one has.
Sourcepub fn error(&self) -> ReadSignal<Option<HttpError>>
pub fn error(&self) -> ReadSignal<Option<HttpError>>
Why the last fetch failed, or None once one worked.
Sourcepub fn loading(&self) -> ReadSignal<bool>
pub fn loading(&self) -> ReadSignal<bool>
true while a fetch runs.
Sourcepub fn refresh(&self)
pub fn refresh(&self)
Fetches again now, stopping a fetch still running. A
stopped request starts.
Sourcepub fn stopped(self) -> Http
pub fn stopped(self) -> Http
Fetches nothing until the first refresh, for a
request made on demand. Call it right after cx.http_get.
Trait Implementations§
Auto Trait Implementations§
impl !Send for Http
impl !Sync for Http
impl Forget for Http
impl Freeze for Http
impl Move for Http
impl RefUnwindSafe for Http
impl Unpin for Http
impl UnsafeUnpin for Http
impl UnwindSafe for Http
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more