Skip to main content

rivet_envoy_client/
lib.rs

1pub mod actor;
2pub mod async_counter;
3pub mod commands;
4pub mod config;
5pub mod connection;
6pub mod context;
7pub mod envoy;
8pub mod events;
9pub mod handle;
10pub mod kv;
11pub mod latency_channel;
12pub mod metrics;
13pub mod sqlite;
14pub mod stringify;
15pub(crate) mod time {
16	#[cfg(not(target_arch = "wasm32"))]
17	pub use std::time::Instant;
18	#[cfg(target_arch = "wasm32")]
19	pub use web_time::Instant;
20
21	pub fn now_millis() -> i64 {
22		#[cfg(not(target_arch = "wasm32"))]
23		{
24			std::time::SystemTime::now()
25				.duration_since(std::time::UNIX_EPOCH)
26				.expect("system clock should be after UNIX epoch")
27				.as_millis() as i64
28		}
29
30		#[cfg(target_arch = "wasm32")]
31		{
32			js_sys::Date::now() as i64
33		}
34	}
35}
36pub mod tunnel;
37pub mod utils;
38
39pub use rivet_envoy_protocol as protocol;