Skip to main content

Source

Trait Source 

Source
pub trait Source: Send + Sync {
    type Pages<'a>: Stream<Item = Result<Page<'a>>> + Send + 'a
       where Self: 'a;

    // Required methods
    fn kind(&self) -> &'static str;
    fn discover<'a>(&'a self, root: &'a SourceRef) -> Self::Pages<'a>;
}
Expand description

Discovers and yields the pages to index from a parent reference.

Required Associated Types§

Source

type Pages<'a>: Stream<Item = Result<Page<'a>>> + Send + 'a where Self: 'a

The stream of discovered pages.

Required Methods§

Source

fn kind(&self) -> &'static str

A stable label for this source kind ("crawl", "fs").

Source

fn discover<'a>(&'a self, root: &'a SourceRef) -> Self::Pages<'a>

Begin discovery from root.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Source for FsSource

Source§

type Pages<'a> = impl Stream<Item = Result<Page<'a>, Error>> + Send + 'a where Self: 'a

Source§

impl<F: Fetcher> Source for CrawlSource<F>

Source§

type Pages<'a> = impl Stream<Item = Result<Page<'a>, Error>> + Send + 'a where Self: 'a

Source§

impl<F: Fetcher> Source for GitHubSource<F>

Source§

type Pages<'a> = impl Stream<Item = Result<Page<'a>, Error>> + Send + 'a where Self: 'a