pub struct Registry { /* private fields */ }Expand description
A dataset registry for publishing and retrieving datasets.
The registry stores datasets along with metadata in a structured format, enabling discovery and versioning of datasets.
§Example
use alimentar::{backend::MemoryBackend, registry::Registry};
let backend = MemoryBackend::new();
let registry = Registry::new(Box::new(backend));Implementations§
Source§impl Registry
impl Registry
Sourcepub fn new(backend: Box<dyn StorageBackend>) -> Self
pub fn new(backend: Box<dyn StorageBackend>) -> Self
Creates a new registry with the given storage backend.
Sourcepub fn with_index_path(
backend: Box<dyn StorageBackend>,
index_path: impl Into<String>,
) -> Self
pub fn with_index_path( backend: Box<dyn StorageBackend>, index_path: impl Into<String>, ) -> Self
Creates a new registry with a custom index path.
Sourcepub fn init(&self) -> Result<()>
pub fn init(&self) -> Result<()>
Initializes the registry by creating an empty index if one doesn’t exist.
§Errors
Returns an error if the index cannot be created.
Sourcepub fn load_index(&self) -> Result<RegistryIndex>
pub fn load_index(&self) -> Result<RegistryIndex>
Sourcepub fn list(&self) -> Result<Vec<DatasetInfo>>
pub fn list(&self) -> Result<Vec<DatasetInfo>>
Lists all available datasets in the registry.
§Errors
Returns an error if the index cannot be loaded.
Sourcepub fn get_info(&self, name: &str) -> Result<DatasetInfo>
pub fn get_info(&self, name: &str) -> Result<DatasetInfo>
Sourcepub fn publish(
&self,
name: &str,
version: &str,
dataset: &ArrowDataset,
metadata: DatasetMetadata,
) -> Result<()>
pub fn publish( &self, name: &str, version: &str, dataset: &ArrowDataset, metadata: DatasetMetadata, ) -> Result<()>
Sourcepub fn search(&self, query: &str) -> Result<Vec<DatasetInfo>>
pub fn search(&self, query: &str) -> Result<Vec<DatasetInfo>>
Searches datasets by query string (matches name and description).
§Errors
Returns an error if the index cannot be loaded.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Registry
impl !RefUnwindSafe for Registry
impl Send for Registry
impl Sync for Registry
impl Unpin for Registry
impl UnsafeUnpin for Registry
impl !UnwindSafe for Registry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.