Skip to main content

StrRead

Trait StrRead 

Source
pub trait StrRead {
    // Required method
    fn peek_str(&self) -> Option<&str>;

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

The base trait that both RealStrRead and StringRead need to implement.

Required Methods§

Source

fn peek_str(&self) -> Option<&str>

Get a reference to the next &str.

Returns None if it’s empty.

Provided Methods§

Source

fn is_empty(&self) -> bool

Check if there is nothing to pop.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl StrRead for String

Source§

fn peek_str(&self) -> Option<&str>

Source§

impl StrRead for str

Source§

fn peek_str(&self) -> Option<&str>

Source§

impl<R: StrRead + ?Sized> StrRead for Box<R>

Source§

fn peek_str(&self) -> Option<&str>

Implementors§