Skip to main content

SemanticError

Enum SemanticError 

Source
#[non_exhaustive]
pub enum SemanticError {
Show 40 variants EmptyModel, ModelHasSurroundingWhitespace, InvalidSimilarityThreshold, ZeroTopK, ZeroMaxVectors, EmptyVector { node: String, }, NonFiniteVectorValue { node: String, index: usize, }, ZeroVector { node: String, }, TooManyVectors { count: usize, maximum: usize, }, DuplicateNode { node: String, }, MissingGraphNode { node: String, }, DimensionMismatch { node: String, expected: usize, actual: usize, }, NumericOverflow, AllocationFailed, ZeroCandidatePoolMultiplier, CandidateKeyOutOfRange { key: u64, vector_count: usize, }, EmptySeoSite { node: String, }, SeoSiteHasSurroundingWhitespace { node: String, }, EmptySeoCanonical { node: String, }, SeoCanonicalHasSurroundingWhitespace { node: String, }, EmptySeoLanguage { node: String, }, SeoLanguageHasSurroundingWhitespace { node: String, }, DuplicateSeoProfile { node: String, }, MissingSeoProfile { node: String, }, SeoProfileMissingGraphNode { node: String, }, EmptyAnchorModel, AnchorModelHasSurroundingWhitespace, InvalidAnchorSimilarityThreshold, ZeroAnchorSuggestions, EmptyAnchorLocator { source: String, }, EmptyAnchorText { source: String, locator: String, }, EmptyAnchorContext { source: String, locator: String, }, AnchorTextOutsideContext { source: String, locator: String, }, AnchorTextHasSurroundingWhitespace { source: String, locator: String, field: &'static str, }, DuplicateAnchorCandidate { source: String, locator: String, }, MissingAnchorTargetVector { target: String, }, AnchorDimensionMismatch { source: String, locator: String, expected: usize, actual: usize, }, AnchorModelMismatch { expected: String, actual: String, }, MissingSemanticEdgeAttribute { attribute: &'static str, }, Graph(GraphError),
}
Expand description

Validation and graph-integration failures.

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

EmptyModel

The model identifier is empty.

§

ModelHasSurroundingWhitespace

The model identifier has leading or trailing whitespace.

§

InvalidSimilarityThreshold

The cosine threshold is non-finite or outside [0, 1].

§

ZeroTopK

Top-K must be positive.

§

ZeroMaxVectors

The configured vector limit must be positive.

§

EmptyVector

A vector has no dimensions.

Fields

§node: String
§

NonFiniteVectorValue

A vector contains NaN or infinity.

Fields

§node: String
§index: usize
§

ZeroVector

A vector has no direction and cannot be compared with cosine similarity.

Fields

§node: String
§

TooManyVectors

More vectors were supplied than the caller-configured safety bound.

Fields

§count: usize
§maximum: usize
§

DuplicateNode

Two vectors target the same graph node.

Fields

§node: String
§

MissingGraphNode

A vector targets a node absent from the input graph.

Fields

§node: String
§

DimensionMismatch

Vectors from the same model have inconsistent dimensions.

Fields

§node: String
§expected: usize
§actual: usize
§

NumericOverflow

A platform-sized counter could not be represented in graph metadata.

§

AllocationFailed

Semantic candidate or report storage could not be reserved.

§

ZeroCandidatePoolMultiplier

The vector candidate-pool multiplier must be positive.

§

CandidateKeyOutOfRange

A candidate engine returned a key outside the current semantic input.

Fields

§key: u64
§vector_count: usize
§

EmptySeoSite

An SEO site identifier is empty.

Fields

§node: String
§

SeoSiteHasSurroundingWhitespace

An SEO site identifier has leading or trailing whitespace.

Fields

§node: String
§

EmptySeoCanonical

An SEO canonical identifier is empty.

Fields

§node: String
§

SeoCanonicalHasSurroundingWhitespace

An SEO canonical identifier has leading or trailing whitespace.

Fields

§node: String
§

EmptySeoLanguage

An SEO language identifier is empty.

Fields

§node: String
§

SeoLanguageHasSurroundingWhitespace

An SEO language identifier has leading or trailing whitespace.

Fields

§node: String
§

DuplicateSeoProfile

More than one SEO profile targets the same graph node.

Fields

§node: String
§

MissingSeoProfile

A semantic vector has no corresponding SEO profile.

Fields

§node: String
§

SeoProfileMissingGraphNode

An SEO profile targets a node absent from the graph.

Fields

§node: String
§

EmptyAnchorModel

The anchor matcher model identifier is empty.

§

AnchorModelHasSurroundingWhitespace

The anchor matcher model identifier has surrounding whitespace.

§

InvalidAnchorSimilarityThreshold

The anchor similarity threshold is non-finite or outside [0, 1].

§

ZeroAnchorSuggestions

At least one anchor suggestion per link must be requested.

§

EmptyAnchorLocator

A candidate anchor locator is empty.

Fields

§source: String
§

EmptyAnchorText

Candidate anchor text is empty.

Fields

§source: String
§locator: String
§

EmptyAnchorContext

Candidate anchor context is empty.

Fields

§source: String
§locator: String
§

AnchorTextOutsideContext

Candidate anchor text is not present in its supplied source context.

Fields

§source: String
§locator: String
§

AnchorTextHasSurroundingWhitespace

Candidate anchor text metadata has surrounding whitespace.

Fields

§source: String
§locator: String
§field: &'static str
§

DuplicateAnchorCandidate

More than one candidate uses the same source and locator.

Fields

§source: String
§locator: String
§

MissingAnchorTargetVector

A semantic link target has no page vector for anchor matching.

Fields

§target: String
§

AnchorDimensionMismatch

A candidate anchor vector does not match the target-vector dimension.

Fields

§source: String
§locator: String
§expected: usize
§actual: usize
§

AnchorModelMismatch

A semantic edge was produced by another embedding model.

Fields

§expected: String
§actual: String
§

MissingSemanticEdgeAttribute

A semantic edge is missing an attribute required for anchor matching.

Fields

§attribute: &'static str
§

Graph(GraphError)

The underlying graph rejected a kind, identifier, provenance, or edge.

Trait Implementations§

Source§

impl Debug for SemanticError

Source§

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

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

impl Display for SemanticError

Source§

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

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

impl Error for SemanticError

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<GraphError> for SemanticError

Source§

fn from(error: GraphError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.