pub struct SuperSTACEngine { /* private fields */ }Expand description
Runtime entry point. Wraps a storage backend, runs background health
checks and /collections introspection, and exposes the federated search
- discovery API.
Construct, call start(), then use search() / list_collections() /
describe_collection(). start() is idempotent — search() will call
it for you if needed.
Implementations§
Source§impl SuperSTACEngine
impl SuperSTACEngine
Sourcepub fn new(storage: Box<dyn StorageBackend + Send + Sync>) -> Self
pub fn new(storage: Box<dyn StorageBackend + Send + Sync>) -> Self
Build an engine over the given storage. Construct the storage via
superstac_config::init_from_yaml or directly via
superstac_core::models::storage::Storage::init.
Sourcepub async fn start(&self) -> Result<(), SuperSTACError>
pub async fn start(&self) -> Result<(), SuperSTACError>
Run health checks against all catalogs, then introspect /collections
on the healthy ones. Idempotent — safe to call multiple times.
Sourcepub async fn ensure_started(&self) -> Result<(), SuperSTACError>
pub async fn ensure_started(&self) -> Result<(), SuperSTACError>
start() if we haven’t already. Called automatically by search()
and the discovery methods.
Sourcepub async fn search(
&self,
query: SearchQuery,
) -> Result<SearchResponse, SuperSTACError>
pub async fn search( &self, query: SearchQuery, ) -> Result<SearchResponse, SuperSTACError>
Federated search. Applies source selection (filter catalogs that can’t possibly serve the requested collections), then fans out.
Sourcepub async fn list_collections(
&self,
) -> Result<Vec<CollectionAvailability>, SuperSTACError>
pub async fn list_collections( &self, ) -> Result<Vec<CollectionAvailability>, SuperSTACError>
Aggregated view: every collection ID known across healthy catalogs, with the catalogs that serve each.
Sourcepub async fn catalogs_supporting(
&self,
collection_id: &str,
) -> Result<Vec<String>, SuperSTACError>
pub async fn catalogs_supporting( &self, collection_id: &str, ) -> Result<Vec<String>, SuperSTACError>
IDs of every catalog whose introspected /collections includes
collection_id. Catalogs not yet introspected are excluded.
Sourcepub async fn collections_by_catalog(
&self,
) -> Result<HashMap<String, Vec<String>>, SuperSTACError>
pub async fn collections_by_catalog( &self, ) -> Result<HashMap<String, Vec<String>>, SuperSTACError>
Per-catalog inventory: catalog ID -> sorted canonical collection IDs. Catalogs without introspection data are omitted.
Sourcepub async fn describe_collection(
&self,
catalog_id: &str,
collection_id: &str,
) -> Result<Option<Collection>, SuperSTACError>
pub async fn describe_collection( &self, catalog_id: &str, collection_id: &str, ) -> Result<Option<Collection>, SuperSTACError>
Fetch full collection metadata from a specific catalog. The
collection_id is interpreted as canonical and resolved to the
catalog’s local name via collection_aliases. Returns None if the
catalog returns 404 for the collection.
Auto Trait Implementations§
impl !Freeze for SuperSTACEngine
impl !RefUnwindSafe for SuperSTACEngine
impl !UnwindSafe for SuperSTACEngine
impl Send for SuperSTACEngine
impl Sync for SuperSTACEngine
impl Unpin for SuperSTACEngine
impl UnsafeUnpin for SuperSTACEngine
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
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>
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>
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 more