Cargo Features
[dependencies]
gloo-net = { version = "0.6.0", default-features = false, features = ["json", "websocket", "http", "eventsource", "io-util"] }
- default = eventsource, http, json, websocket
-
These default features are set whenever
gloo-net
is added without
somewhere in the dependency tree.default-features = false - json default = serde, serde_json
-
Enables
.json()
onResponse
Enables serde of gloo-utils
- websocket default = futures-channel, futures-core, futures-sink, pin-project
-
Enables the WebSocket API
Enables AddEventListenerOptions, BinaryType, Blob, CloseEvent, CloseEventInit, ErrorEvent, FileReader, MessageEvent, ProgressEvent and WebSocket of web-sys
Affects
gloo-net::websocket
… - http default
-
Enables the HTTP API
Enables AbortSignal, Blob, FormData, Headers, ObserverCallback, ReadableStream, ReferrerPolicy, Request, RequestCache, RequestCredentials, RequestInit, RequestMode, RequestRedirect, Response, ResponseInit, ResponseType, Url and UrlSearchParams of web-sys
Affects
gloo-net::http
… - eventsource default = futures-channel, futures-core, pin-project
-
Enables the EventSource API
Enables Event, EventSource, EventTarget and MessageEvent of web-sys
Affects
gloo-net::eventsource
… - io-util = futures-io
-
As of now, only implements
AsyncRead
andAsyncWrite
onWebSocket
Features from optional dependencies
In crates that don't use the dep:
syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.