Trait smart_read::ReadLine

source ·
pub trait ReadLine: Sized {
    type Output;

    // Required method
    fn try_read_line(
        &self,
        prompt: Option<String>,
        default: Option<Self::Output>
    ) -> BoxResult<Self::Output>;

    // Provided method
    fn read_line(
        &self,
        prompt: Option<String>,
        default: Option<Self::Output>
    ) -> Self::Output { ... }
}
Expand description

This is what powers the whole crate. Any struct that implements this can be passed to read!(), try_read!(), prompt!(), and try_prompt!()

Required Associated Types§

Required Methods§

source

fn try_read_line( &self, prompt: Option<String>, default: Option<Self::Output> ) -> BoxResult<Self::Output>

Provided Methods§

source

fn read_line( &self, prompt: Option<String>, default: Option<Self::Output> ) -> Self::Output

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T: Display + Clone + PartialEq> ReadLine for &[T]

§

type Output = T

source§

fn try_read_line( &self, prompt: Option<String>, default: Option<T> ) -> BoxResult<Self::Output>

source§

impl<T: Display + Clone + PartialEq> ReadLine for LinkedList<T>

§

type Output = T

source§

fn try_read_line( &self, prompt: Option<String>, default: Option<T> ) -> BoxResult<Self::Output>

source§

impl<T: Display + Clone + PartialEq> ReadLine for VecDeque<T>

§

type Output = T

source§

fn try_read_line( &self, prompt: Option<String>, default: Option<T> ) -> BoxResult<Self::Output>

source§

impl<T: Display + Clone + PartialEq> ReadLine for Vec<T>

§

type Output = T

source§

fn try_read_line( &self, prompt: Option<String>, default: Option<T> ) -> BoxResult<Self::Output>

source§

impl<T: Display + Clone + PartialEq, const LEN: usize> ReadLine for &[T; LEN]

§

type Output = T

source§

fn try_read_line( &self, prompt: Option<String>, default: Option<T> ) -> BoxResult<Self::Output>

source§

impl<T: Display + FromStr + PartialOrd<T>> ReadLine for Range<T>

§

type Output = T

source§

fn try_read_line( &self, prompt: Option<String>, default: Option<T> ) -> BoxResult<Self::Output>

source§

impl<T: Display + FromStr + PartialOrd<T>> ReadLine for RangeFrom<T>

§

type Output = T

source§

fn try_read_line( &self, prompt: Option<String>, default: Option<T> ) -> BoxResult<Self::Output>

source§

impl<T: Display + FromStr + PartialOrd<T>> ReadLine for RangeInclusive<T>

§

type Output = T

source§

fn try_read_line( &self, prompt: Option<String>, default: Option<T> ) -> BoxResult<Self::Output>

source§

impl<T: Display + FromStr + PartialOrd<T>> ReadLine for RangeTo<T>

§

type Output = T

source§

fn try_read_line( &self, prompt: Option<String>, default: Option<T> ) -> BoxResult<Self::Output>

source§

impl<T: Display + FromStr + PartialOrd<T>> ReadLine for RangeToInclusive<T>

§

type Output = T

source§

fn try_read_line( &self, prompt: Option<String>, default: Option<T> ) -> BoxResult<Self::Output>

Implementors§