Skip to main content

wse_client/
lib.rs

1// The README shows encryption and signing: the crate documentation with them.
2#![cfg_attr(feature = "aws-lc", doc = include_str!("../README.md"))]
3
4// In the browser the crypto is RustCrypto: there is no FIPS module there.
5#[cfg(all(feature = "fips", target_arch = "wasm32"))]
6compile_error!("the fips feature needs aws-lc-rs, which does not build for the browser");
7// WebAssembly outside the browser has no WebSocket of the page to drive.
8#[cfg(all(target_arch = "wasm32", not(target_os = "unknown")))]
9compile_error!("wse-client runs natively, or in the browser (wasm32-unknown-unknown)");
10
11#[cfg(all(feature = "bridge", not(target_arch = "wasm32")))]
12pub mod bridge;
13#[cfg(target_arch = "wasm32")]
14mod browser;
15mod client;
16mod config;
17#[cfg(not(target_arch = "wasm32"))]
18mod connection;
19mod decode;
20mod delivery;
21mod error;
22mod events;
23mod frames;
24mod handler;
25mod message;
26#[cfg(all(feature = "native", not(target_arch = "wasm32")))]
27pub mod native;
28mod outbox;
29mod policy;
30mod scan;
31mod security;
32mod sequencer;
33mod session;
34
35pub use client::{Client, SendOptions, Status};
36#[cfg(feature = "aws-lc")]
37pub use config::Encryption;
38pub use config::{Config, Format, Reconnect, TokenProvider};
39pub use delivery::{Continuity, Delivery, StreamPosition, Subscription, TopicState};
40pub use error::Error;
41pub use events::{Events, Incoming, connect, start};
42pub use handler::{
43    CheckpointRejected, Connected, Disconnected, Event, Gap, GapReason, Handler, MaybeSend,
44    NotDelivered, Paused, Recovery, Resync, ServerError, StorageFailed, Subscribed,
45    TopicContinuity,
46};
47pub use message::{Message, OwnedMessage, Position, Signature};
48pub use outbox::Offline;
49#[cfg(feature = "aws-lc")]
50pub use security::with_crypto::{generate_key, public_key, public_key_jwk};