pub struct InputBuffer {
pub buf_ct: usize,
pub strin: bool,
pub lineno: usize,
pub lexstop: bool,
/* private fields */
}Expand description
Input buffer state
Fields§
§buf_ct: usizeTotal characters available
strin: boolWhether we’re reading from a string
lineno: usizeCurrent line number
lexstop: boolStop lexing flag
Implementations§
Source§impl InputBuffer
impl InputBuffer
pub fn new() -> Self
Sourcepub fn shin_buf_reset(&mut self)
pub fn shin_buf_reset(&mut self)
Reset the SHIN buffer
Sourcepub fn shin_buf_alloc(&mut self)
pub fn shin_buf_alloc(&mut self)
Allocate a new SHIN buffer
Sourcepub fn shin_buf_save(&mut self)
pub fn shin_buf_save(&mut self)
Save current SHIN buffer state
Sourcepub fn shin_buf_restore(&mut self)
pub fn shin_buf_restore(&mut self)
Restore saved SHIN buffer state
Sourcepub fn shin_getchar<R: Read>(
&mut self,
reader: &mut BufReader<R>,
) -> Option<char>
pub fn shin_getchar<R: Read>( &mut self, reader: &mut BufReader<R>, ) -> Option<char>
Get next character from a reader
Sourcepub fn shin_getline<R: Read>(
&mut self,
reader: &mut BufReader<R>,
) -> Option<String>
pub fn shin_getline<R: Read>( &mut self, reader: &mut BufReader<R>, ) -> Option<String>
Read a line from shell input, encoding meta characters
Sourcepub fn inpush(&mut self, s: &str, flags: u32, alias: Option<String>)
pub fn inpush(&mut self, s: &str, flags: u32, alias: Option<String>)
Push a string onto the input stack
Sourcepub fn inpop_alias(&mut self)
pub fn inpop_alias(&mut self)
Expunge any aliases from the input stack
Sourcepub fn inputsetline(&mut self, s: &str, flags: u32)
pub fn inputsetline(&mut self, s: &str, flags: u32)
Set the input line directly
Sourcepub fn inerrflush(&mut self)
pub fn inerrflush(&mut self)
Flush remaining input (on error)
Sourcepub fn input_has_alias(&self) -> Option<&str>
pub fn input_has_alias(&self) -> Option<&str>
Check if current input is from an alias
Sourcepub fn take_raw_input(&mut self) -> String
pub fn take_raw_input(&mut self) -> String
Get and clear raw input
Trait Implementations§
Auto Trait Implementations§
impl Freeze for InputBuffer
impl RefUnwindSafe for InputBuffer
impl Send for InputBuffer
impl Sync for InputBuffer
impl Unpin for InputBuffer
impl UnsafeUnpin for InputBuffer
impl UnwindSafe for InputBuffer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more