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 default-features = false somewhere in the dependency tree.

json default = serde, serde_json

Enables .json() on Response

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 and AsyncWrite on WebSocket

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.

futures-core eventsource websocket
futures-sink websocket
futures-io io-util?
serde json
serde_json json
futures-channel eventsource websocket
pin-project eventsource websocket