Skip to main content

Error

Enum Error 

Source
#[non_exhaustive]
pub enum Error {
Show 15 variants NotFound { uri: String, }, NotModified { uri: String, }, Unauthenticated { message: String, }, PermissionDenied { message: String, }, RateLimited { retry_after_ms: u64, }, Http { status: u16, message: String, }, InvalidUrl { message: String, }, Crawl { source_kind: &'static str, message: String, }, Extract { message: String, }, Embed { message: String, }, Format { message: String, }, DimMismatch { index: usize, query: usize, }, Timeout { duration_ms: u64, }, Backend { backend: &'static str, message: String, }, Io { source: Error, },
}
Expand description

The unified error type for every link-r operation.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

NotFound

A resource (page, index file) could not be found.

Fields

§uri: String

The URI/path that was missing.

§

NotModified

The remote returned 304 Not Modified — used as the unchanged sentinel for incremental rebuilds.

Fields

§uri: String

The URI that was unchanged.

§

Unauthenticated

Authentication was required and failed or was missing.

Fields

§message: String

Human-readable detail.

§

PermissionDenied

The credential was valid but lacked permission.

Fields

§message: String

Human-readable detail.

§

RateLimited

The remote rate-limited us; retry after the given delay.

Fields

§retry_after_ms: u64

Suggested backoff in milliseconds (from Retry-After / x-ratelimit-reset).

§

Http

A non-success HTTP status that isn’t modelled more specifically.

Fields

§status: u16

The HTTP status code.

§message: String

Human-readable detail.

§

InvalidUrl

A malformed or unsupported URL.

Fields

§message: String

Human-readable detail.

§

Crawl

Discovery/crawl failed for a source.

Fields

§source_kind: &'static str

The source kind (e.g. "http", "fs").

§message: String

Human-readable detail.

§

Extract

Content extraction failed.

Fields

§message: String

Human-readable detail.

§

Embed

Embedding failed.

Fields

§message: String

Human-readable detail.

§

Format

The on-disk index format was invalid or corrupt.

Fields

§message: String

Human-readable detail.

§

DimMismatch

A query/index dimension mismatch (e.g. searching with the wrong embedder).

Fields

§index: usize

The index’s embedding dimension.

§query: usize

The query vector’s dimension.

§

Timeout

An operation timed out.

Fields

§duration_ms: u64

The elapsed budget in milliseconds.

§

Backend

An error originating from a named backend dependency.

Fields

§backend: &'static str

The backend that produced the error (e.g. "reqwest", "fastembed").

§message: String

Human-readable detail.

§

Io

An underlying I/O error.

Fields

§source: Error

The wrapped I/O error.

Implementations§

Source§

impl Error

Source

pub fn not_found(uri: impl Into<String>) -> Self

Construct a Error::NotFound.

Source

pub fn not_modified(uri: impl Into<String>) -> Self

Construct a Error::NotModified.

Source

pub fn unauthenticated(message: impl Into<String>) -> Self

Source

pub fn permission_denied(message: impl Into<String>) -> Self

Source

pub fn rate_limited(retry_after_ms: u64) -> Self

Construct a Error::RateLimited.

Source

pub fn http(status: u16, message: impl Into<String>) -> Self

Construct a Error::Http.

Source

pub fn invalid_url(message: impl Into<String>) -> Self

Construct a Error::InvalidUrl.

Source

pub fn crawl(source_kind: &'static str, message: impl Into<String>) -> Self

Construct a Error::Crawl.

Source

pub fn extract(message: impl Into<String>) -> Self

Construct a Error::Extract.

Source

pub fn embed(message: impl Into<String>) -> Self

Construct a Error::Embed.

Source

pub fn format(message: impl Into<String>) -> Self

Construct a Error::Format.

Source

pub fn backend(backend: &'static str, message: impl Into<String>) -> Self

Construct a Error::Backend.

Source

pub fn is_retriable(&self) -> bool

Whether retrying the failed operation could plausibly succeed.

Drives backoff in the fetch/crawl layer: timeouts, rate limits, transient HTTP 5xx/408/429, and recoverable I/O conditions are retriable; logical errors (not found, auth, format) are not.

Trait Implementations§

Source§

impl Debug for Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Error

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for Error

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

graph-r core (byte codecs, container, mmap) reports malformed images as format errors; its I/O stays I/O.

Source§

fn from(e: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Error

§

impl !UnwindSafe for Error

§

impl Freeze for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnsafeUnpin for Error

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToCompactString for T
where T: Display,

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more