pub enum DetectorValidatorSpec {
Crc32Base62 {
prefixes: Vec<String>,
entropy_len: usize,
checksum_len: usize,
reject_overlong: bool,
confidence_floor: f64,
},
GithubFineGrainedCrc32 {
prefixes: Vec<String>,
left_len: usize,
right_len: usize,
checksum_len: usize,
confidence_floor: f64,
},
Base64Payload {
prefixes: Vec<String>,
alphabet: DetectorBase64Alphabet,
min_encoded_len: usize,
max_encoded_len: usize,
min_decoded_len: usize,
confidence_floor: f64,
},
PatternShape {
prefixes: Vec<String>,
allow_overlong: bool,
},
}Expand description
An offline validator declared by one detector.
The enum is deliberately closed and typed: malformed combinations are rejected while loading detector TOML instead of becoming runtime defaults.
Variants§
Crc32Base62
CRC32 over a fixed entropy body, encoded as a fixed-width base62 suffix.
Fields
GithubFineGrainedCrc32
GitHub fine-grained PAT CRC32 layout with two underscore-separated segments and compatibility for the two formats GitHub has emitted.
Fields
Base64Payload
A base64 payload whose successful decode is offline authenticity evidence, such as the macaroon carried by a PyPI API token.
Fields
§
alphabet: DetectorBase64AlphabetPatternShape
The detector’s own patterns are the complete structural contract. The scanner compiles anchored copies once for generic/public validation; named matches reuse the already-proven pattern result without rerunning a second regex.
Implementations§
Trait Implementations§
Source§impl Clone for DetectorValidatorSpec
impl Clone for DetectorValidatorSpec
Source§fn clone(&self) -> DetectorValidatorSpec
fn clone(&self) -> DetectorValidatorSpec
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DetectorValidatorSpec
impl Debug for DetectorValidatorSpec
Source§impl<'de> Deserialize<'de> for DetectorValidatorSpec
impl<'de> Deserialize<'de> for DetectorValidatorSpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for DetectorValidatorSpec
impl PartialEq for DetectorValidatorSpec
Source§impl Serialize for DetectorValidatorSpec
impl Serialize for DetectorValidatorSpec
impl StructuralPartialEq for DetectorValidatorSpec
Auto Trait Implementations§
impl Freeze for DetectorValidatorSpec
impl RefUnwindSafe for DetectorValidatorSpec
impl Send for DetectorValidatorSpec
impl Sync for DetectorValidatorSpec
impl Unpin for DetectorValidatorSpec
impl UnsafeUnpin for DetectorValidatorSpec
impl UnwindSafe for DetectorValidatorSpec
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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