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§
Sourcefn on_child_data<F>(&mut self, data: &[u8], parent_write: F)
fn on_child_data<F>(&mut self, data: &[u8], parent_write: F)
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.
Sourcefn on_parent_data<F>(&mut self, data: &[u8], child_write: F)
fn on_parent_data<F>(&mut self, data: &[u8], child_write: F)
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.
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.