pub struct GitHubSource<F: Fetcher> { /* private fields */ }Expand description
A GitHub repository source over a Fetcher.
The repository reference lives on the source itself; the root argument of
Source::discover is ignored (there is nothing to crawl from — the
tree call enumerates everything).
Implementations§
Source§impl<F: Fetcher> GitHubSource<F>
impl<F: Fetcher> GitHubSource<F>
Sourcepub fn new(fetcher: F, spec: GithubSpec) -> Self
pub fn new(fetcher: F, spec: GithubSpec) -> Self
Create a source for spec over fetcher (pair it with GithubAuth).
Sourcepub fn bases(
self,
api_base: impl Into<CompactString>,
raw_base: impl Into<CompactString>,
) -> Self
pub fn bases( self, api_base: impl Into<CompactString>, raw_base: impl Into<CompactString>, ) -> Self
Override the API and raw base URLs (GitHub Enterprise, tests).
Sourcepub fn depth(self, depth: u16) -> Self
pub fn depth(self, depth: u16) -> Self
Cap how many directory levels below the subdir are indexed (0 = only files directly in it). Default: unlimited.
Sourcepub fn max_bytes(self, max_bytes: u64) -> Self
pub fn max_bytes(self, max_bytes: u64) -> Self
Per-file byte ceiling. Oversized files are skipped without a fetch — the tree listing already carries each blob’s size.
Sourcepub fn concurrency(self, concurrency: usize) -> Self
pub fn concurrency(self, concurrency: usize) -> Self
Maximum blob fetches in flight at once (clamped to ≥ 1).
Sourcepub fn accept_extension(self, extension: impl AsRef<str>) -> Self
pub fn accept_extension(self, extension: impl AsRef<str>) -> Self
Only index files whose path ends with extension (additive).
Sourcepub fn validators(
self,
entries: impl IntoIterator<Item = (UrlKey, CompactString)>,
) -> Self
pub fn validators( self, entries: impl IntoIterator<Item = (UrlKey, CompactString)>, ) -> Self
Provide known blob SHAs (keyed by canonical raw-URL key) so unchanged files are revalidated without any fetch.
Sourcepub fn take_revalidated(&self) -> Vec<Url>
pub fn take_revalidated(&self) -> Vec<Url>
Files revalidated (blob SHA unchanged, nothing fetched) during the most recent discover. Same contract as the crawler’s: this is the only place those checks are visible, and a freshness tracker consumes it.
Sourcepub fn failed_count(&self) -> u32
pub fn failed_count(&self) -> u32
Files whose blob fetch failed during the most recent discover.
Trait Implementations§
Auto Trait Implementations§
impl<F> !Freeze for GitHubSource<F>
impl<F> RefUnwindSafe for GitHubSource<F>where
F: RefUnwindSafe,
impl<F> Send for GitHubSource<F>
impl<F> Sync for GitHubSource<F>
impl<F> Unpin for GitHubSource<F>where
F: Unpin,
impl<F> UnsafeUnpin for GitHubSource<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for GitHubSource<F>where
F: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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