Trait filterm::Filter

source ·
pub trait Filter {
    // Provided methods
    fn on_child_data<F>(&mut self, data: &[u8], parent_write: F)
       where F: FnMut(&[u8]) { ... }
    fn on_parent_data<F>(&mut self, data: &[u8], child_write: F)
       where F: FnMut(&[u8]) { ... }
}
Expand description

A trait for filtering data to and from a child terminal.

An object implementing this trait should be passed to run.

Provided Methods§

source

fn on_child_data<F>(&mut self, data: &[u8], parent_write: F)where F: FnMut(&[u8]),

Called when data from the child terminal is received.

parent_write should be called (any number of times) to forward this data, or send different data, to the parent terminal. The default implementation of this method forwards all data unchanged.

source

fn on_parent_data<F>(&mut self, data: &[u8], child_write: F)where F: FnMut(&[u8]),

Called when data from the parent terminal is received.

child_write should be called (any number of times) to forward this data, or send different data, to the child terminal. The default implementation of this method forwards all data unchanged.

Implementors§