[−][src]Struct tcalc_rustyline::Editor
Line editor
Methods
impl<C: Completer> Editor<C>
[src]
pub fn new() -> Editor<C>
[src]
pub fn with_config(config: Config) -> Editor<C>
[src]
pub fn readline(&mut self, prompt: &str) -> Result<String>
[src]
This method will read a line from STDIN and will display a prompt
pub fn load_history<P: AsRef<Path> + ?Sized>(&mut self, path: &P) -> Result<()>
[src]
Load the history from the specified file.
pub fn save_history<P: AsRef<Path> + ?Sized>(&self, path: &P) -> Result<()>
[src]
Save the history in the specified file.
pub fn add_history_entry<S: AsRef<str> + Into<String>>(
&mut self,
line: S
) -> bool
[src]
&mut self,
line: S
) -> bool
Add a new entry in the history.
pub fn clear_history(&mut self)
[src]
Clear history.
pub fn get_history(&mut self) -> &mut History
[src]
Return a reference to the history object.
pub fn set_completer(&mut self, completer: Option<C>)
[src]
Register a callback function to be called for tab-completion.
ⓘImportant traits for Iter<'a, C>pub fn iter<'a>(&'a mut self, prompt: &'a str) -> Iter<C>
[src]
ⓘImportant traits for Iter<'a, C>
let mut rl = tcalc_rustyline::Editor::<()>::new(); for readline in rl.iter("> ") { match readline { Ok(line) => { println!("Line: {}", line); }, Err(err) => { println!("Error: {:?}", err); break } } }
Trait Implementations
Auto Trait Implementations
impl<C> Send for Editor<C> where
C: Send,
C: Send,
impl<C> Unpin for Editor<C> where
C: Unpin,
C: Unpin,
impl<C> Sync for Editor<C> where
C: Sync,
C: Sync,
impl<C> UnwindSafe for Editor<C> where
C: UnwindSafe,
C: UnwindSafe,
impl<C> RefUnwindSafe for Editor<C> where
C: RefUnwindSafe,
C: RefUnwindSafe,
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,