Skip to main content

Builtin

Struct Builtin 

Source
pub struct Builtin {
    pub id: &'static str,
    pub display_name: &'static str,
    pub severity: Severity,
    pub regex_src: &'static str,
    pub regex: OnceLock<Regex>,
    pub metadata: Option<PatternMetadata>,
    pub rotation: Option<RotationSpec>,
    pub liveness: Option<LivenessSpec>,
}
Expand description

Adapter struct that turns a static data row into a SecretPattern implementation. Each BUILTINS entry is a Builtin; the regex compiles lazily on first access via OnceLock so process startup pays nothing for patterns that are never consulted.

Fields§

§id: &'static str

Stable identifier (lowercase kebab-case).

§display_name: &'static str

Human-readable name.

§severity: Severity

Severity to attach to a leak finding.

§regex_src: &'static str

Regex source — compiled lazily into Builtin::regex.

§regex: OnceLock<Regex>

Lazily-compiled regex. Use Builtin::compiled_regex in preference to touching this field directly.

§metadata: Option<PatternMetadata>

Optional descriptive metadata (provider id, retrieval URL, expiry default, scope hints).

§rotation: Option<RotationSpec>

Optional rotation hint. None for v1; populated when P2.4 wires inheritance.

§liveness: Option<LivenessSpec>

Optional liveness probe. None for v1; populated when P9.2 adds provider liveness checks.

Trait Implementations§

Source§

impl SecretPattern for Builtin

Source§

fn id(&self) -> &str

Stable identifier (lowercase, kebab-case). Used as a foreign key from the global index entry’s pattern_id (ADR-020 §3) and as a join key with other tools that consume the catalogue.
Source§

fn display_name(&self) -> &str

Human-readable name shown in secrets describe and in scan-tool reports.
Source§

fn severity(&self) -> Severity

Severity to attach to a leak finding for this pattern.
Source§

fn format_regex(&self) -> &Regex

Regular expression matching valid values of this kind. Read more
Source§

fn metadata(&self) -> Option<&PatternMetadata>

Optional descriptive metadata (provider, retrieval URL, expiry, scopes). Read more
Source§

fn rotation(&self) -> Option<&RotationSpec>

Optional rotation hint (manual vs provider-driven). Read more
Source§

fn liveness(&self) -> Option<&LivenessSpec>

Optional liveness probe specification. Read more

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