Cargo Features
[dependencies]
gloo-net = { version = "0.7.0", default-features = false, features = ["json", "websocket", "http", "eventsource", "io-util", "browser-test"] }
- default = eventsource, http, json, websocket
-
These default features are set whenever
gloo-netis added withoutsomewhere in the dependency tree.default-features = false - json default = serde, serde_json
-
Enables
.json()onResponseEnables 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, EventSourceInit, EventTarget and MessageEvent of web-sys
Affects
gloo-net::eventsource… - io-util = futures-io
-
As of now, only implements
AsyncReadandAsyncWriteonWebSocket - browser-test
-
For test runner only. Enables browser tests.
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.