Skip to main content

QuoteOptionsBuilder

Struct QuoteOptionsBuilder 

Source
pub struct QuoteOptionsBuilder<S: State = Empty> { /* private fields */ }
Expand description

Use builder syntax to set the inputs and finish with build().

Implementations§

Source§

impl<S: State> QuoteOptionsBuilder<S>

Source

pub fn build(self) -> QuoteOptions
where S: IsComplete,

Finish building and return the requested object

Source

pub fn always_quote(self, value: bool) -> QuoteOptionsBuilder<SetAlwaysQuote<S>>
where S::AlwaysQuote: IsUnset,

Optional (Some / Option setters). Default: false.

Whether to quote the input even if nothing in it needs quoting.

Source

pub fn maybe_always_quote( self, value: Option<bool>, ) -> QuoteOptionsBuilder<SetAlwaysQuote<S>>
where S::AlwaysQuote: IsUnset,

Optional (Some / Option setters). Default: false.

Whether to quote the input even if nothing in it needs quoting.

Source

pub fn preferred_mode( self, value: QuoteMode, ) -> QuoteOptionsBuilder<SetPreferredMode<S>>
where S::PreferredMode: IsUnset,

Optional (Some / Option setters). Default: <QuoteMode as Default>::default().

Preferred mode for quoting. It’s upgraded to ANSI-C quoting ($'...') if the input has chars only that can express.

Source

pub fn maybe_preferred_mode( self, value: Option<QuoteMode>, ) -> QuoteOptionsBuilder<SetPreferredMode<S>>
where S::PreferredMode: IsUnset,

Optional (Some / Option setters). Default: <QuoteMode as Default>::default().

Preferred mode for quoting. It’s upgraded to ANSI-C quoting ($'...') if the input has chars only that can express.

Source

pub fn avoid_ansi_c_quoting_newline( self, value: bool, ) -> QuoteOptionsBuilder<SetAvoidAnsiCQuotingNewline<S>>
where S::AvoidAnsiCQuotingNewline: IsUnset,

Optional (Some / Option setters). Default: false.

Whether to avoid ANSI-C quoting just for newlines, which otherwise require it.

Source

pub fn maybe_avoid_ansi_c_quoting_newline( self, value: Option<bool>, ) -> QuoteOptionsBuilder<SetAvoidAnsiCQuotingNewline<S>>
where S::AvoidAnsiCQuotingNewline: IsUnset,

Optional (Some / Option setters). Default: false.

Whether to avoid ANSI-C quoting just for newlines, which otherwise require it.

Source

pub fn leave_leading_hash( self, value: bool, ) -> QuoteOptionsBuilder<SetLeaveLeadingHash<S>>
where S::LeaveLeadingHash: IsUnset,

Optional (Some / Option setters). Default: false.

Whether to leave a # starting the input unquoted. Bash does in some output that isn’t read back as shell input, e.g. tracing a [[ -n ... ]] test.

Source

pub fn maybe_leave_leading_hash( self, value: Option<bool>, ) -> QuoteOptionsBuilder<SetLeaveLeadingHash<S>>
where S::LeaveLeadingHash: IsUnset,

Optional (Some / Option setters). Default: false.

Whether to leave a # starting the input unquoted. Bash does in some output that isn’t read back as shell input, e.g. tracing a [[ -n ... ]] test.

Source

pub fn leave_tilde(self, value: bool) -> QuoteOptionsBuilder<SetLeaveTilde<S>>
where S::LeaveTilde: IsUnset,

Optional (Some / Option setters). Default: false.

Whether to leave a ~ unquoted where it would be tilde-expanded. Bash does when quoting a file name it completes, so that a ~user completion still expands.

Source

pub fn maybe_leave_tilde( self, value: Option<bool>, ) -> QuoteOptionsBuilder<SetLeaveTilde<S>>
where S::LeaveTilde: IsUnset,

Optional (Some / Option setters). Default: false.

Whether to leave a ~ unquoted where it would be tilde-expanded. Bash does when quoting a file name it completes, so that a ~user completion still expands.

Source

pub fn quote_commas(self, value: bool) -> QuoteOptionsBuilder<SetQuoteCommas<S>>
where S::QuoteCommas: IsUnset,

Optional (Some / Option setters). Default: false.

Whether to quote commas, which aren’t special on their own. Bash’s printf %q does, so its output is safe even inside a brace expansion.

Source

pub fn maybe_quote_commas( self, value: Option<bool>, ) -> QuoteOptionsBuilder<SetQuoteCommas<S>>
where S::QuoteCommas: IsUnset,

Optional (Some / Option setters). Default: false.

Whether to quote commas, which aren’t special on their own. Bash’s printf %q does, so its output is safe even inside a brace expansion.

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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