Skip to main content

SuperSTACEngine

Struct SuperSTACEngine 

Source
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

Source

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.

Source

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.

Source

pub async fn shutdown(&self)

Cancel background health-monitor tasks. Doesn’t drop the storage.

Source

pub async fn ensure_started(&self) -> Result<(), SuperSTACError>

start() if we haven’t already. Called automatically by search() and the discovery methods.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<G1, G2> Within<G2> for G1
where G2: Contains<G1>,

Source§

fn is_within(&self, b: &G2) -> bool