Skip to content

Commit 4995c64

Browse files
committed
public iter_external_loaders
1 parent 1853070 commit 4995c64

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

crates/re_data_source/src/data_loader/loader_external.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ pub static EXTERNAL_LOADER_PATHS: Lazy<Vec<std::path::PathBuf>> = Lazy::new(|| {
4444
executables.into_iter().collect()
4545
});
4646

47+
/// Iterator over all registered [`DataLoader`]s.
48+
#[inline]
49+
pub fn iter_external_loaders() -> impl ExactSizeIterator<Item = std::path::PathBuf> {
50+
EXTERNAL_LOADER_PATHS.iter().cloned()
51+
}
52+
53+
// ---
54+
4755
// TODO: this is the stdio integration
4856
// TODO: binary plugin example and indicate how to not care about ext
4957
pub struct ExternalDataLoader;
@@ -54,7 +62,7 @@ impl crate::DataLoader for ExternalDataLoader {
5462
"rerun.data_loaders.External".into()
5563
}
5664

57-
fn load_from_file(
65+
fn load_from_path(
5866
&self,
5967
store_id: re_log_types::StoreId,
6068
filepath: std::path::PathBuf,
@@ -127,7 +135,7 @@ impl crate::DataLoader for ExternalDataLoader {
127135
}
128136

129137
#[inline]
130-
fn load_from_file_contents(
138+
fn load_from_path_contents(
131139
&self,
132140
_store_id: re_log_types::StoreId,
133141
_path: std::path::PathBuf,

crates/re_data_source/src/data_loader/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,4 +189,6 @@ pub use self::loader_rrd::RrdLoader;
189189
#[cfg(not(target_arch = "wasm32"))]
190190
pub(crate) use self::loader_external::EXTERNAL_LOADER_PATHS;
191191
#[cfg(not(target_arch = "wasm32"))]
192-
pub use self::loader_external::{ExternalDataLoader, EXTERNAL_DATA_LOADER_PREFIX};
192+
pub use self::loader_external::{
193+
iter_external_loaders, ExternalDataLoader, EXTERNAL_DATA_LOADER_PREFIX,
194+
};

crates/re_data_source/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ mod web_sockets;
1515
mod load_stdin;
1616

1717
pub use self::data_loader::{
18-
iter_loaders, ArchetypeLoader, DataLoader, DataLoaderError, LoadedData, RrdLoader,
18+
iter_external_loaders, iter_loaders, ArchetypeLoader, DataLoader, DataLoaderError, LoadedData,
19+
RrdLoader,
1920
};
2021
pub use self::data_source::DataSource;
2122
pub use self::load_file::load_from_path_contents;

0 commit comments

Comments
 (0)