pub struct LinkExtractor { /* private fields */ }Expand description
In-memory cache + HTTP client. Held by the runtime as
Arc<LinkExtractor> and shared across sessions; the extractor
owns its rate limiter so concurrent turns don’t stampede.
Implementations§
Source§impl LinkExtractor
impl LinkExtractor
pub fn new(cfg: &LinkUnderstandingConfig) -> Self
Sourcepub fn cache_capacity(&self) -> usize
pub fn cache_capacity(&self) -> usize
Capacity of the in-memory cache (for tests / diagnostics).
Sourcepub async fn fetch(
&self,
url: &str,
cfg: &LinkUnderstandingConfig,
) -> Option<LinkSummary>
pub async fn fetch( &self, url: &str, cfg: &LinkUnderstandingConfig, ) -> Option<LinkSummary>
Fetch + extract, honouring the cache. Returns None on any
error — the caller (llm_behavior) drops the URL from the
rendered block silently.
Auto Trait Implementations§
impl !Freeze for LinkExtractor
impl !RefUnwindSafe for LinkExtractor
impl !UnwindSafe for LinkExtractor
impl Send for LinkExtractor
impl Sync for LinkExtractor
impl Unpin for LinkExtractor
impl UnsafeUnpin for LinkExtractor
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> 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