euv_core/dynamic/engine/
const.rs1pub const DEFAULT_CANDIDATE_MAILBOX_CAPACITY: usize = 4;
3
4pub const DEFAULT_MAX_ARTIFACT_BYTES: u64 = 16 * 1024 * 1024;
6
7pub const DEFAULT_UPDATE_HTTP_TIMEOUT_MS: u64 = 5_000;
9
10pub const DEFAULT_SSE_RECONNECT_MS: u64 = 100;
12
13pub const UPDATE_WORKER_THREAD_NAME: &str = "euv-update-worker";
15
16pub const ENV_EUV_UPDATE_URL: &str = "EUV_UPDATE_URL";
18
19pub const ENV_EUV_UPDATE_CHANNEL: &str = "EUV_UPDATE_CHANNEL";
21
22pub const ENV_EUV_UPDATE_CACHE_DIR: &str = "EUV_UPDATE_CACHE_DIR";
24
25pub const ENV_EUV_PROXY_URL: &str = "EUV_PROXY_URL";
27
28pub const ENV_HTTPS_PROXY: &str = "HTTPS_PROXY";
30
31pub const ENV_HTTP_PROXY: &str = "HTTP_PROXY";
33
34pub const ENV_HTTPS_PROXY_LOWER: &str = "https_proxy";
36
37pub const ENV_HTTP_PROXY_LOWER: &str = "http_proxy";
39
40pub const DEFAULT_HOT_UPDATE_SERVER_URL: &str = "http://127.0.0.1:8787";
42
43pub const DEFAULT_HOT_UPDATE_CHANNEL: &str = "prod";
45
46pub const DEFAULT_POLL_FALLBACK_SECS: u64 = 30;
48
49pub const DEFAULT_UPDATE_HTTP_PORT: u16 = 80;
51
52pub const HOT_UPDATE_CACHE_BLOBS_DIR: &str = "blobs";
54
55pub const HOT_UPDATE_CACHE_ACTIVE_MANIFEST: &str = "active_manifest.json";
57
58pub const HOT_UPDATE_CACHE_PREV_MANIFEST: &str = "previous_manifest.json";
60
61pub const UPDATE_CACHE_RESTORE_SOURCE: &str = "euv-update-cache";
63
64#[cfg(not(target_arch = "wasm32"))]
66pub(crate) const HOT_UPDATE_CACHE_TMP_SUFFIX: &str = ".tmp";
67
68pub(crate) const ERR_WASM_EMIT_EMPTY: &str =
70 "wasm artifact emitted neither DynamicNodeSpec nor DynamicUpdateBundle";
71
72#[cfg(not(target_arch = "wasm32"))]
74pub(crate) const HDR_PROXY_AUTHORIZATION: &str = "Proxy-Authorization";
75
76#[cfg(not(target_arch = "wasm32"))]
78pub(crate) const HDR_PROXY_CONNECTION: &str = "Proxy-Connection";
79
80pub(crate) const BASE64_STD_TABLE: &[u8; 64] =
82 b"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
83
84#[cfg(not(target_arch = "wasm32"))]
86pub(crate) const UPDATE_HTTP_SCHEME: &str = "http://";
87
88#[cfg(not(target_arch = "wasm32"))]
90pub(crate) const HTTP_HEADER_END_MARKER: &[u8] = b"\r\n\r\n";
91
92#[cfg(not(target_arch = "wasm32"))]
94pub(crate) const HDR_LAST_EVENT_ID: &str = "Last-Event-ID";
95
96#[cfg(not(target_arch = "wasm32"))]
98pub(crate) const HDR_RANGE: &str = "Range";
99
100#[cfg(not(target_arch = "wasm32"))]
102pub(crate) const HDR_TRANSFER_ENCODING_CHUNKED: &str = "chunked";
103
104#[cfg(not(target_arch = "wasm32"))]
106pub(crate) const HDR_TRANSFER_ENCODING_KEY: &str = "transfer-encoding";
107
108#[cfg(not(target_arch = "wasm32"))]
110pub(crate) const HDR_CONTENT_LENGTH_KEY: &str = "content-length";
111
112#[cfg(not(target_arch = "wasm32"))]
114pub(crate) const SSE_WIRE_ID_PREFIX: &str = "id:";
115
116#[cfg(not(target_arch = "wasm32"))]
118pub(crate) const SSE_WIRE_EVENT_PREFIX: &str = "event:";
119
120#[cfg(not(target_arch = "wasm32"))]
122pub(crate) const SSE_WIRE_DATA_PREFIX: &str = "data:";
123
124#[cfg(not(target_arch = "wasm32"))]
126pub(crate) const QUERY_MODE_WASM: &str = "wasm_component";
127
128#[cfg(not(target_arch = "wasm32"))]
130pub(crate) const QUERY_MODE_DATA: &str = "declarative_data";
131
132#[cfg(not(target_arch = "wasm32"))]
134pub(crate) const ERR_INVALID_HTTP_BASE_URL: &str =
135 "update server base_url must use http://host:port";
136
137#[cfg(not(target_arch = "wasm32"))]
139pub(crate) const ERR_MALFORMED_HTTP_RESP: &str = "malformed HTTP response from update server";
140
141#[cfg(not(target_arch = "wasm32"))]
143pub(crate) const ERR_HTTP_NON_OK: &str = "unexpected HTTP status from update server";
144
145pub(crate) const ERR_WASM_ARTIFACT_ABI: &str = "wasm artifact failed host ABI export check";
147
148pub(crate) const ERR_DECLARATIVE_JSON: &str =
150 "declarative artifact payload is not a valid DynamicNodeSpec";
151
152pub(crate) const ERR_ACTION_DENIED: &str = "cross-route action is not permitted by host policy";
154
155pub(crate) const ERR_ACTION_CANCELLED: &str =
157 "cross-route action cancelled by stale generation token";
158
159pub(crate) const ERR_NO_ACTIVE_GENERATION: &str = "no active release generation installed";
161
162#[cfg(not(target_arch = "wasm32"))]
164pub(crate) const ERR_WORKER_SPAWN: &str = "failed to spawn background update worker thread";
165
166#[cfg(target_arch = "wasm32")]
168pub(crate) const ERR_WASM32_SYNC_HTTP: &str =
169 "synchronous TCP HTTP transport unavailable on wasm32";