pub struct Resource {
pub url: Url,
pub kind: ResourceKind,
pub etag: Option<CompactString>,
pub size: Option<u64>,
}Expand description
A remote document the index resolves to. The body lives at Resource::url
and is fetched lazily by the caller; the index stores only this addressing
plus a distilled descriptor.
Fields§
§url: UrlThe canonical remote URL.
kind: ResourceKindThe content class.
etag: Option<CompactString>An opaque change token (HTTP ETag, git blob SHA, or content hash) used to
skip re-embedding unchanged pages on re-crawl.
size: Option<u64>The body size in bytes, if known.
Implementations§
Source§impl Resource
impl Resource
Sourcepub fn with_kind(self, kind: ResourceKind) -> Self
pub fn with_kind(self, kind: ResourceKind) -> Self
Set the content kind explicitly (e.g. from a Content-Type header).
Sourcepub fn with_etag(self, etag: impl Into<CompactString>) -> Self
pub fn with_etag(self, etag: impl Into<CompactString>) -> Self
Set the change token.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Resource
impl RefUnwindSafe for Resource
impl Send for Resource
impl Sync for Resource
impl Unpin for Resource
impl UnsafeUnpin for Resource
impl UnwindSafe for Resource
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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