Skip to main content

SecretScanErrorCode

Enum SecretScanErrorCode 

Source
#[non_exhaustive]
pub enum SecretScanErrorCode {
Show 26 variants InvalidInput, InvalidOptions, InvalidDetector, DetectorFailure, InvalidCandidate, PolicyFailure, InvalidPolicyAction, InvalidFindings, PlaceholderFailure, InvalidPlaceholder, InvalidLimits, InputLimitExceeded, BufferLimitExceeded, TokenLimitExceeded, MultilineLimitExceeded, FindingLimitExceeded, InvalidState, InvalidRuleset, PiiSelectorInvalid, PiiSelectorUnsupported, PiiSelectorUnavailable, PiiActivationConflict, InvalidActionPolicy, InvalidDetectionConfig, DetectionConfigConflict, EmptyDetectionSet,
}
Expand description

Fixed public error codes.

The string form (as_str) and the message (message) are part of the cross-language contract and must not change without a corpus review.

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

InvalidInput

The host passed something other than a text input. The core itself only accepts &str, so this code is produced by bindings.

§

InvalidOptions

Scan options could not be interpreted. Produced by bindings that accept dynamically typed option objects.

§

InvalidDetector

A detector registration was rejected: malformed or duplicate id.

§

DetectorFailure

A detector reported a failure while scanning.

§

InvalidCandidate

A detector returned a candidate that violates the candidate contract.

§

PolicyFailure

The policy reported a failure while evaluating a finding.

§

InvalidPolicyAction

A policy returned something that is not one of the four actions. The Rust Action enum cannot express this, so this code is produced by bindings that accept dynamically typed actions.

§

InvalidFindings

A redaction finding is out of range, misordered, or overlaps another finding.

§

PlaceholderFailure

The placeholder formatter reported a failure while redacting.

§

InvalidPlaceholder

The placeholder formatter returned an empty, oversized, or matched-value-reproducing placeholder.

§

InvalidLimits

An incremental session’s or whole-input operation’s limits were missing, non-positive, or did not satisfy the documented relationship between them.

§

InputLimitExceeded

An accepted input would exceed the configured input-byte limit: an incremental session’s total accepted input across every append, or a whole-input scan/redact/scan_and_redact call’s input.

§

BufferLimitExceeded

An incremental session’s retained, unresolved plaintext would exceed max_buffered_bytes.

§

TokenLimitExceeded

An incremental session’s open single-line construct would exceed max_token_bytes without closing.

§

MultilineLimitExceeded

An incremental session’s open PEM-style private-key block would exceed max_multiline_bytes without closing.

§

FindingLimitExceeded

The accepted finding count from a whole-input scan would exceed the configured finding-count limit. Only whole-input scan and scan_and_redact (and redact given an externally-constructed finding list) produce this code; there is no incremental equivalent.

§

InvalidState

An incremental session received append, finalize, or abort after it left the accepting state.

§

InvalidRuleset

A caller-supplied declarative ruleset was rejected while loading (decision-define-declarative-detector-ruleset-contract). The fixed rejection class is carried separately by RulesetError::class, never by this code alone.

§

PiiSelectorInvalid

A PII selector does not match the accepted lowercase grammar.

§

PiiSelectorUnsupported

A valid PII selector names no supported jurisdiction or family.

§

PiiSelectorUnavailable

A known PII jurisdiction or family is absent from this artifact.

§

PiiActivationConflict

PII initialization conflicts with the already active selection.

§

InvalidActionPolicy

A caller-supplied declarative action policy was rejected while loading (decision-define-the-versioned-declarative-action-policy-and-default-overlay). The fixed rejection class and the rule index are carried separately by ActionPolicyError, never by this code alone.

§

InvalidDetectionConfig

A detector-id selection was rejected while a registry or an owner was configured (decision-define-detector-id-selection-and-configuration-replacement-precedence). The fixed rejection class is carried separately by DetectionConfigError::class_name, never by this code alone.

§

DetectionConfigConflict

A detector-selection initialization differs from the configuration the owner is already fixed to. A conflict changes nothing.

§

EmptyDetectionSet

The configuration leaves nothing enabled: no built-in detector, no ruleset and no PII family. Binding it to a scan owner is refused; a preview still describes it.

Implementations§

Source§

impl SecretScanErrorCode

Source

pub const ALL: [Self; 26]

Every code, in declaration order.

Source

pub const fn as_str(self) -> &'static str

The stable SCREAMING_SNAKE_CASE code string.

Source

pub const fn message(self) -> &'static str

The fixed, input-free message for this code.

Trait Implementations§

Source§

impl Clone for SecretScanErrorCode

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for SecretScanErrorCode

Source§

impl Debug for SecretScanErrorCode

Source§

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

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

impl Display for SecretScanErrorCode

Source§

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

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

impl Eq for SecretScanErrorCode

Source§

impl From<SecretScanErrorCode> for SecretScanError

Source§

fn from(code: SecretScanErrorCode) -> Self

Converts to this type from the input type.
Source§

impl Hash for SecretScanErrorCode

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for SecretScanErrorCode

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
Source§

impl PartialEq for SecretScanErrorCode

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialOrd for SecretScanErrorCode

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl StructuralPartialEq for SecretScanErrorCode

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.