re_data_source/
lib.rs

1//! Handles different ways of loading Rerun data, e.g.:
2//!
3//! - Over HTTPS
4//! - Over gRPC
5//! - From disk
6//!
7//! Also handles different file types: rrd, images, text files, 3D models, point clouds…
8
9mod data_source;
10mod stream_rrd_from_http;
11
12#[cfg(not(target_arch = "wasm32"))]
13mod load_stdin;
14
15pub use self::data_source::{AuthErrorHandler, LogDataSource, LogDataSourceAnalytics};
16pub use re_redap_client::StreamMode;
17
18// ----------------------------------------------------------------------------
19
20/// The contents of a file.
21///
22/// This is what you get when loading a file on Web, or when using drag-n-drop.
23//
24// TODO(#4554): drag-n-drop streaming support
25#[derive(Clone, PartialEq, Eq)]
26pub struct FileContents {
27    pub name: String,
28    pub bytes: std::sync::Arc<[u8]>,
29}
30
31impl std::fmt::Debug for FileContents {
32    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
33        f.debug_struct("FileContents")
34            .field("name", &self.name)
35            .field("bytes", &format_args!("{} bytes", self.bytes.len()))
36            .finish()
37    }
38}