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;
10
11#[cfg(not(target_arch = "wasm32"))]
12mod load_stdin;
13
14pub use self::data_source::LogDataSource;
15
16// ----------------------------------------------------------------------------
17
18/// The contents of a file.
19///
20/// This is what you get when loading a file on Web, or when using drag-n-drop.
21//
22// TODO(#4554): drag-n-drop streaming support
23#[derive(Clone, PartialEq, Eq)]
24pub struct FileContents {
25    pub name: String,
26    pub bytes: std::sync::Arc<[u8]>,
27}
28
29impl std::fmt::Debug for FileContents {
30    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
31        f.debug_struct("FileContents")
32            .field("name", &self.name)
33            .field("bytes", &format_args!("{} bytes", self.bytes.len()))
34            .finish()
35    }
36}