Expand description
§vzglyd_sidecar
Networking and IPC utilities for VZGLYD slide sidecars.
A sidecar is a companion wasm32-wasip1 program that fetches external data and pushes it
into a paired slide over the VZGLYD host channel.
§Typical Structure
use vzglyd_sidecar::{https_get_text, poll_loop};
fn main() {
poll_loop(60, || {
let body = https_get_text("api.example.com", "/data")?;
Ok(body.into_bytes())
});
}This crate is primarily intended for the wasm32-wasip1 target used by VZGLYD sidecars.
Enums§
- Error
- Errors returned by network and channel helpers.
Functions§
- channel_
active - Return
truewhen the paired slide is currently active on screen. - channel_
poll - Poll the shared channel for the latest payload.
- channel_
push - Push a new payload into the shared sidecar-to-slide channel.
- env_var
- Read an environment variable from the sidecar process.
- https_
get - Perform an HTTPS
GETrequest and return the raw response body. - https_
get_ conditional - Perform a conditional HTTPS
GETrequest usingETagandLast-Modifiedhints. - https_
get_ text - Perform an HTTPS
GETrequest and decode the body as UTF-8 text. - info_
log - Emit an informational log message through the VZGLYD host.
- poll_
loop - Repeatedly fetch payloads and push them into the slide channel.
- sleep_
secs - Sleep for a whole number of seconds.
- split_
https_ url - Split an HTTPS URL into
(host, path)for use withhttps_gethelpers. - tcp_
connect - Attempt a TCP connection and return the time taken to establish it.
Type Aliases§
- Conditional
GetResult - Body, ETag, and Last-Modified returned by a conditional GET.