#[non_exhaustive]pub enum SimilarCodeError {
ZeroDimensions,
InvalidThreshold,
ExtractionVersion {
location: FunctionLocation,
expected: u32,
actual: u32,
},
DimensionMismatch {
location: FunctionLocation,
expected: usize,
actual: usize,
},
NonFiniteVector {
location: FunctionLocation,
},
ZeroMagnitudeVector {
location: FunctionLocation,
},
DuplicateFunctionIdentity {
location: FunctionLocation,
},
SelectionLengthMismatch {
expected: usize,
actual: usize,
},
SelectionLimitExceeded {
reason: SimilarCodeSkipReason,
observed: usize,
limit: usize,
},
}Expand description
Invalid input rejected before candidate output is produced.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ZeroDimensions
The configured vector width was zero.
InvalidThreshold
The similarity threshold was non-finite or outside -1 through 1.
ExtractionVersion
A vector used an unexpected extraction version.
Fields
location: FunctionLocationSource location of the invalid vector.
DimensionMismatch
A vector width differed from the configured width.
Fields
location: FunctionLocationSource location of the invalid vector.
NonFiniteVector
A vector contained NaN or infinity.
Fields
location: FunctionLocationSource location of the invalid vector.
ZeroMagnitudeVector
A vector had zero magnitude and cannot be compared by cosine similarity.
Fields
location: FunctionLocationSource location of the invalid vector.
DuplicateFunctionIdentity
More than one vector claimed the same stable function identity.
Fields
location: FunctionLocationSource location shared by the duplicate inputs.
SelectionLengthMismatch
Preselected vector or scope count did not match the source selection contract.
Fields
SelectionLimitExceeded
A caller-supplied preselection exceeded one current hard limit.
Trait Implementations§
Source§impl Clone for SimilarCodeError
impl Clone for SimilarCodeError
Source§impl Debug for SimilarCodeError
impl Debug for SimilarCodeError
Source§impl Display for SimilarCodeError
impl Display for SimilarCodeError
impl Eq for SimilarCodeError
Source§impl Error for SimilarCodeError
impl Error for SimilarCodeError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl PartialEq for SimilarCodeError
impl PartialEq for SimilarCodeError
impl StructuralPartialEq for SimilarCodeError
Auto Trait Implementations§
impl Freeze for SimilarCodeError
impl RefUnwindSafe for SimilarCodeError
impl Send for SimilarCodeError
impl Sync for SimilarCodeError
impl Unpin for SimilarCodeError
impl UnsafeUnpin for SimilarCodeError
impl UnwindSafe for SimilarCodeError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read moreSource§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more