pub struct SourceRegistry { /* private fields */ }Expand description
Registry for all available research sources
The SourceRegistry manages all available source plugins and provides methods to query and use them.
Implementations§
Source§impl SourceRegistry
impl SourceRegistry
Sourcepub fn try_new() -> Result<Self, SourceError>
pub fn try_new() -> Result<Self, SourceError>
Try to create a new registry with all available sources
This will:
- Filter sources based on config file or environment variables
- Skip sources that fail to initialize (e.g., missing API keys)
- Return an error only if no sources could be initialized
Sourcepub fn get_required(&self, id: &str) -> Result<&Arc<dyn Source>, SourceError>
pub fn get_required(&self, id: &str) -> Result<&Arc<dyn Source>, SourceError>
Get a source by ID, returning an error if not found
Sourcepub fn with_capability(
&self,
capability: SourceCapabilities,
) -> Vec<&Arc<dyn Source>>
pub fn with_capability( &self, capability: SourceCapabilities, ) -> Vec<&Arc<dyn Source>>
Get sources that support a specific capability
Sourcepub fn searchable(&self) -> Vec<&Arc<dyn Source>>
pub fn searchable(&self) -> Vec<&Arc<dyn Source>>
Get sources that support search
Sourcepub fn downloadable(&self) -> Vec<&Arc<dyn Source>>
pub fn downloadable(&self) -> Vec<&Arc<dyn Source>>
Get sources that support download
Sourcepub fn with_citations(&self) -> Vec<&Arc<dyn Source>>
pub fn with_citations(&self) -> Vec<&Arc<dyn Source>>
Get sources that support citations
Trait Implementations§
Source§impl Clone for SourceRegistry
impl Clone for SourceRegistry
Source§fn clone(&self) -> SourceRegistry
fn clone(&self) -> SourceRegistry
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SourceRegistry
impl Debug for SourceRegistry
Auto Trait Implementations§
impl Freeze for SourceRegistry
impl !RefUnwindSafe for SourceRegistry
impl Send for SourceRegistry
impl Sync for SourceRegistry
impl Unpin for SourceRegistry
impl !UnwindSafe for SourceRegistry
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more