Struct shell_quote::Quotable

source ·
pub struct Quotable<'a> { /* private fields */ }
Expand description

A string of bytes that can be quoted/escaped.

This is used by many methods in this crate as a generic Into<Quotable> constraint. Why not accept [AsRef<[u8]>] instead? The ergonomics of that approach were not so good. For example, quoting OsString/OsStr and PathBuf/Path didn’t work in a natural way.

Trait Implementations§

source§

impl<'a> From<&'a [u8]> for Quotable<'a>

source§

fn from(source: &'a [u8]) -> Quotable<'a>

Converts to this type from the input type.
source§

impl<'a, const N: usize> From<&'a [u8; N]> for Quotable<'a>

source§

fn from(source: &'a [u8; N]) -> Quotable<'a>

Converts to this type from the input type.
source§

impl<'a> From<&'a BStr> for Quotable<'a>

source§

fn from(source: &'a BStr) -> Quotable<'a>

Converts to this type from the input type.
source§

impl<'a> From<&'a BString> for Quotable<'a>

source§

fn from(source: &'a BString) -> Quotable<'a>

Converts to this type from the input type.
source§

impl<'a> From<&'a OsStr> for Quotable<'a>

source§

fn from(source: &'a OsStr) -> Quotable<'a>

Converts to this type from the input type.
source§

impl<'a> From<&'a OsString> for Quotable<'a>

source§

fn from(source: &'a OsString) -> Quotable<'a>

Converts to this type from the input type.
source§

impl<'a> From<&'a Path> for Quotable<'a>

source§

fn from(source: &'a Path) -> Quotable<'a>

Converts to this type from the input type.
source§

impl<'a> From<&'a PathBuf> for Quotable<'a>

source§

fn from(source: &'a PathBuf) -> Quotable<'a>

Converts to this type from the input type.
source§

impl<'a> From<&'a String> for Quotable<'a>

source§

fn from(source: &'a String) -> Quotable<'a>

Converts to this type from the input type.
source§

impl<'a> From<&'a Vec<u8>> for Quotable<'a>

source§

fn from(source: &'a Vec<u8>) -> Quotable<'a>

Converts to this type from the input type.
source§

impl<'a> From<&'a str> for Quotable<'a>

source§

fn from(source: &'a str) -> Quotable<'a>

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for Quotable<'a>

§

impl<'a> Send for Quotable<'a>

§

impl<'a> Sync for Quotable<'a>

§

impl<'a> Unpin for Quotable<'a>

§

impl<'a> UnwindSafe for Quotable<'a>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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, U> Into<U> for Twhere 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<'a, S> QuoteRefExt<BString> for Swhere S: Into<Quotable<'a>> + ?Sized,

source§

fn quoted<Q>(self, _q: Q) -> BStringwhere Q: Quoter,

source§

impl<'a, S> QuoteRefExt<OsString> for Swhere S: Into<Quotable<'a>> + ?Sized,

source§

fn quoted<Q>(self, _q: Q) -> OsStringwhere Q: Quoter,

source§

impl<'a, S> QuoteRefExt<String> for Swhere S: Into<Quotable<'a>> + ?Sized,

source§

fn quoted<Q>(self, _q: Q) -> Stringwhere Q: Quoter,

source§

impl<'a, S> QuoteRefExt<Vec<u8>> for Swhere S: Into<Quotable<'a>> + ?Sized,

source§

fn quoted<Q>(self, _q: Q) -> Vec<u8> where Q: Quoter,

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.