yash_syntax::syntax

Trait Unquote

source
pub trait Unquote {
    // Required method
    fn write_unquoted<W: Write>(&self, w: &mut W) -> Result<bool, Error>;

    // Provided method
    fn unquote(&self) -> (String, bool) { ... }
}
Expand description

Removing quotes from syntax without performing expansion.

This trail will be useful only in a limited number of use cases. In the normal word expansion process, quote removal is done after other kinds of expansions like parameter expansion, so this trait is not used.

Required Methods§

source

fn write_unquoted<W: Write>(&self, w: &mut W) -> Result<bool, Error>

Converts self to a string with all quotes removed and writes to w.

Provided Methods§

source

fn unquote(&self) -> (String, bool)

Converts self to a string with all quotes removed.

Returns a tuple of a string and a bool. The string is an unquoted version of self. The bool tells whether there is any quotes contained in self.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T: Unquote> Unquote for [T]

Implementors§