pub struct Beacon { /* private fields */ }Expand description
Asynchronously send a small amount of data to an HTTP server.
This API is intended to send analytics and diagnostics data to a server before a document is unloaded.
See MDN - Navigator.sendBeacon for more.
§Examples
ⓘ
document.on("unload", || {
let beacon = Beacon::new();
beacon.send_to("localhost:8080/log", b"client closed");
});Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Beacon
impl RefUnwindSafe for Beacon
impl !Send for Beacon
impl !Sync for Beacon
impl Unpin for Beacon
impl UnwindSafe for Beacon
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