pub struct Quoter { /* private fields */ }
Expand description
A more configurable interface to quote strings. If you only want the default settings you can
use the convenience functions try_quote
and try_join
.
The bytes equivalent is bytes::Quoter
.
Implementations§
source§impl Quoter
impl Quoter
sourcepub fn allow_nul(self, allow: bool) -> Self
pub fn allow_nul(self, allow: bool) -> Self
Set whether to allow nul bytes. By default they are not
allowed and will result in an error of QuoteError::Nul
.
sourcepub fn join<'a, I: IntoIterator<Item = &'a str>>(
&self,
words: I
) -> Result<String, QuoteError>
pub fn join<'a, I: IntoIterator<Item = &'a str>>( &self, words: I ) -> Result<String, QuoteError>
Convenience function that consumes an iterable of words and turns it into a single string, quoting words when necessary. Consecutive words will be separated by a single space.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Quoter
impl Send for Quoter
impl Sync for Quoter
impl Unpin for Quoter
impl UnwindSafe for Quoter
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