Trait StringRead

Source
pub trait StringRead: StrRead {
    // Required methods
    fn pop_string(&mut self) -> Option<String>;
    fn peek_mut_string(&mut self) -> Option<&mut String>;

    // Provided method
    fn map_string(&mut self, f: impl FnMut(&mut String)) { ... }
}
Expand description

Represent anything that pops out String.

Required Methods§

Source

fn pop_string(&mut self) -> Option<String>

Remove the next String and return it.

Source

fn peek_mut_string(&mut self) -> Option<&mut String>

Get a mutable reference to the next String.

Provided Methods§

Source

fn map_string(&mut self, f: impl FnMut(&mut String))

Change the next String that will be poped.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl StringRead for String

Source§

fn pop_string(&mut self) -> Option<String>

Source§

fn map_string(&mut self, f: impl FnMut(&mut String))

Source§

fn peek_mut_string(&mut self) -> Option<&mut String>

Implementors§