Skip to main content

Unquote

Trait Unquote 

Source
pub trait Unquote<'a> {
    // Required methods
    fn is_quoted(&self) -> bool;
    fn unquote(&self) -> Option<&'a str>;
    fn unquote_infallible(&self) -> &'a str;
}
Expand description

Slice a string between quotes

Required Methods§

Source

fn is_quoted(&self) -> bool

Whether the input is quoted. If this is false the fallible methods of this interface will fail.

Source

fn unquote(&self) -> Option<&'a str>

Unquotes a string. If the input is not quoted it is simply returned as-is. If the input is partially quoted on either end that quote is not removed.

Source

fn unquote_infallible(&self) -> &'a str

Unquotes a string. The input must be quoted on each side for Some to be returned

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'a> Unquote<'a> for &'a str

Source§

fn unquote_infallible(&self) -> &'a str

Source§

fn unquote(&self) -> Option<&'a str>

Source§

fn is_quoted(&self) -> bool

Implementors§