Skip to main content

Extractor

Struct Extractor 

Source
pub struct Extractor<'a> { /* private fields */ }
Expand description

Replaces the sensitive literals of one server’s fields by references.

Implementations§

Source§

impl<'a> Extractor<'a>

Source

pub fn new(server: &'a str, aliases: &'a mut Aliases) -> Self

Extracts for store server server (aliases are <SERVER>_<KEY>).

Source

pub fn finish(self) -> Vec<Extracted>

What was extracted, in field order.

Source

pub fn args(&mut self, args: Vec<String>) -> Vec<String>

Arguments with each sensitive one (or the value part of --flag=value) replaced by a reference.

Source

pub fn url(&mut self, url: String) -> Result<String, CoreError>

The URL with each credential part (userinfo, token query parameter, token-shaped text) replaced by a reference. A URL the classifier flags without a part to cut out is needs_secret_extraction (edit it by hand).

Source

pub fn map( &mut self, label: &str, map: BTreeMap<String, String>, ) -> BTreeMap<String, String>

An env or headers map (label) with each sensitive value replaced by a reference; an Authorization: Bearer style scheme in a header stays around the reference.

Source

pub fn fields(&mut self, fields: &mut ServerFields) -> Result<(), CoreError>

Every sensitive literal of fields (args, the URL, env and headers values) replaced by a reference, in that order.

Auto Trait Implementations§

§

impl<'a> !UnwindSafe for Extractor<'a>

§

impl<'a> Forget for Extractor<'a>

§

impl<'a> Freeze for Extractor<'a>
where &'a str: Freeze, &'a mut Aliases: Freeze, *const u8 is !null: Freeze, PhantomData<Extracted>: Freeze,

§

impl<'a> Move for Extractor<'a>

§

impl<'a> RefUnwindSafe for Extractor<'a>

§

impl<'a> Send for Extractor<'a>
where &'a str: Send, NodeRef<Owned, String, SetValZST, LeafOrInternal>: Send, BoxRaw<(String, SetValZST)>: Send, RawVecInner: Send, &'static str: Send,

§

impl<'a> Sync for Extractor<'a>
where NodeRef<Owned, String, SetValZST, LeafOrInternal>: Sync, BoxRaw<(String, SetValZST)>: Sync, RawVecInner: Sync,

§

impl<'a> Unpin for Extractor<'a>
where &'a str: Unpin, &'a mut Aliases: Unpin, *const u8 is !null: Unpin, &'static str: Unpin,

§

impl<'a> UnsafeUnpin for Extractor<'a>

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

Source§

type Output = T

Should always be Self
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.
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