pub struct GithubUpdateBuilder<'a, E = DefaultEmbedder> { /* private fields */ }Expand description
Configures and runs a GitHub tree-API sync. Created by
LinkIndex::update_github.
Implementations§
Source§impl<'a, E: Embedder> GithubUpdateBuilder<'a, E>
impl<'a, E: Embedder> GithubUpdateBuilder<'a, E>
Sourcepub fn token(self, token: impl Into<String>) -> Self
pub fn token(self, token: impl Into<String>) -> Self
A GitHub token (PAT). Sent as Bearer to the API and raw hosts only —
never to any host a document happens to link to. Required for private
and internal repositories; anonymous works for public ones.
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 directory levels below the subdir (0 = only files directly in it).
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.
Sourcepub fn concurrency(self, concurrency: usize) -> Self
pub fn concurrency(self, concurrency: usize) -> Self
Maximum blob fetches in flight at once.
Sourcepub fn embed_batch(self, n: usize) -> Self
pub fn embed_batch(self, n: usize) -> Self
Set how many pages are embedded per model call (default 64).
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
Known blob SHAs from a persistent backend (keyed by canonical raw-URL
key). Same precedence as UpdateBuilder::validators: the in-memory
index’s own ETags win on conflict; these exist for the stateless
case, where a fresh index syncs a repository the backend already knows.
Sourcepub async fn run(self) -> Result<UpdateReport>
pub async fn run(self) -> Result<UpdateReport>
Run the sync: list the tree (one request), fetch only new/changed blobs, index them, and report unchanged files as revalidated.
§Errors
Returns an error if the tree cannot be listed (bad spec, auth, a truncated listing) or a page cannot be embedded; per-file fetch failures are counted, not propagated.
Trait Implementations§
Auto Trait Implementations§
impl<'a, E = HashEmbedder> !RefUnwindSafe for GithubUpdateBuilder<'a, E>
impl<'a, E = HashEmbedder> !UnwindSafe for GithubUpdateBuilder<'a, E>
impl<'a, E> Freeze for GithubUpdateBuilder<'a, E>
impl<'a, E> Send for GithubUpdateBuilder<'a, E>
impl<'a, E> Sync for GithubUpdateBuilder<'a, E>
impl<'a, E> Unpin for GithubUpdateBuilder<'a, E>
impl<'a, E> UnsafeUnpin for GithubUpdateBuilder<'a, E>where
&'a mut LinkIndex<E>: UnsafeUnpin,
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