Shell

Trait Shell 

Source
pub trait Shell<O, W> {
    type Err: Into<Error>;

    // Required methods
    fn is_avail(&self, name: &str) -> bool;
    fn set_buff(&mut self, w: W);
    fn write_cmd(&mut self, name: &str, opt: &O) -> Result<(), Self::Err>;
    fn write_opt(&mut self, name: &str, opt: &O) -> Result<(), Self::Err>;
    fn write_pos(&mut self, name: &str, opt: &O) -> Result<(), Self::Err>;
    fn write_val(&mut self, val: &OsStr, opt: &O) -> Result<(), Self::Err>;
    fn write_eq(
        &mut self,
        name: &str,
        val: &OsStr,
        opt: &O,
    ) -> Result<(), Self::Err>;
    fn finish(&mut self) -> Result<(), Self::Err>;
    fn take_buff(&mut self) -> Option<W>;
}

Required Associated Types§

Required Methods§

Source

fn is_avail(&self, name: &str) -> bool

Source

fn set_buff(&mut self, w: W)

Source

fn write_cmd(&mut self, name: &str, opt: &O) -> Result<(), Self::Err>

Source

fn write_opt(&mut self, name: &str, opt: &O) -> Result<(), Self::Err>

Source

fn write_pos(&mut self, name: &str, opt: &O) -> Result<(), Self::Err>

Source

fn write_val(&mut self, val: &OsStr, opt: &O) -> Result<(), Self::Err>

Source

fn write_eq( &mut self, name: &str, val: &OsStr, opt: &O, ) -> Result<(), Self::Err>

Source

fn finish(&mut self) -> Result<(), Self::Err>

Source

fn take_buff(&mut self) -> Option<W>

Trait Implementations§

Source§

impl<O, W, E: Into<Error>> Shell<O, W> for Box<dyn Shell<O, W, Err = E>>

Source§

type Err = E

Source§

fn is_avail(&self, name: &str) -> bool

Source§

fn write_cmd(&mut self, name: &str, opt: &O) -> Result<(), Self::Err>

Source§

fn write_opt(&mut self, name: &str, opt: &O) -> Result<(), Self::Err>

Source§

fn write_pos(&mut self, name: &str, opt: &O) -> Result<(), Self::Err>

Source§

fn write_val(&mut self, val: &OsStr, opt: &O) -> Result<(), Self::Err>

Source§

fn write_eq( &mut self, name: &str, val: &OsStr, opt: &O, ) -> Result<(), Self::Err>

Source§

fn set_buff(&mut self, w: W)

Source§

fn finish(&mut self) -> Result<(), Self::Err>

Source§

fn take_buff(&mut self) -> Option<W>

Implementations on Foreign Types§

Source§

impl<O, W, E: Into<Error>> Shell<O, W> for Box<dyn Shell<O, W, Err = E>>

Source§

type Err = E

Source§

fn is_avail(&self, name: &str) -> bool

Source§

fn write_cmd(&mut self, name: &str, opt: &O) -> Result<(), Self::Err>

Source§

fn write_opt(&mut self, name: &str, opt: &O) -> Result<(), Self::Err>

Source§

fn write_pos(&mut self, name: &str, opt: &O) -> Result<(), Self::Err>

Source§

fn write_val(&mut self, val: &OsStr, opt: &O) -> Result<(), Self::Err>

Source§

fn write_eq( &mut self, name: &str, val: &OsStr, opt: &O, ) -> Result<(), Self::Err>

Source§

fn set_buff(&mut self, w: W)

Source§

fn finish(&mut self) -> Result<(), Self::Err>

Source§

fn take_buff(&mut self) -> Option<W>

Implementors§

Source§

impl<'a, O, W, T: Shell<O, W>> Shell<O, W> for AdapterRef<'a, T>

Source§

impl<O, W> Shell<O, W> for Bash<O, W>
where W: Write,

Source§

impl<O, W> Shell<O, W> for Fish<O, W>
where W: Write, O: Opt,

Source§

impl<O, W> Shell<O, W> for PowerShell<O, W>
where W: Write, O: Opt,

Source§

impl<O, W> Shell<O, W> for Zsh<O, W>
where W: Write, O: Opt,

Source§

impl<O, W, T: Shell<O, W>> Shell<O, W> for Adapter<T>