surver/
lib.rs

1//! External access to the Surver server.
2use lazy_static::lazy_static;
3use serde::{Deserialize, Serialize};
4
5#[cfg(not(target_arch = "wasm32"))]
6mod server;
7#[cfg(not(target_arch = "wasm32"))]
8pub use server::server_main;
9
10pub const HTTP_SERVER_KEY: &str = "Server";
11pub const HTTP_SERVER_VALUE_SURFER: &str = "Surfer";
12pub const X_WELLEN_VERSION: &str = "x-wellen-version";
13pub const X_SURFER_VERSION: &str = "x-surfer-version";
14pub const SURFER_VERSION: &str = env!("CARGO_PKG_VERSION");
15pub const WELLEN_VERSION: &str = wellen::VERSION;
16
17pub const WELLEN_SURFER_DEFAULT_OPTIONS: wellen::LoadOptions = wellen::LoadOptions {
18    multi_thread: true,
19    remove_scopes_with_empty_name: true,
20};
21
22#[derive(Debug, Serialize, Deserialize)]
23pub struct Status {
24    pub bytes: u64,
25    pub bytes_loaded: u64,
26    pub filename: String,
27    pub wellen_version: String,
28    pub surfer_version: String,
29    pub file_format: wellen::FileFormat,
30}
31
32lazy_static! {
33    pub static ref BINCODE_OPTIONS: bincode::DefaultOptions = bincode::DefaultOptions::new();
34}