Struct ad_editor::exec::CachedStdin

source ·
pub struct CachedStdin { /* private fields */ }
Expand description

A wrapper around stdin that buffers and caches input so that it can be manipulated like a Buffer

Implementations§

source§

impl CachedStdin

source

pub fn new() -> Self

Trait Implementations§

source§

impl Address for CachedStdin

source§

fn current_dot(&self) -> Dot

This only really makes sense for use with a buffer but is supported so that don’t need to special case running programs against an in-editor buffer vs stdin or a file read from disk.
source§

fn len_chars(&self) -> usize

source§

fn max_iter(&self) -> usize

source§

fn line_to_char(&self, line_idx: usize) -> Option<usize>

source§

fn char_to_line(&self, char_idx: usize) -> Option<usize>

source§

fn char_to_line_end(&self, char_idx: usize) -> Option<usize>

source§

fn char_to_line_start(&self, char_idx: usize) -> Option<usize>

source§

fn map_addr(&self, a: &mut Addr) -> Dot

source§

fn full_line(&self, line_idx: usize) -> Option<Dot>

source§

fn map_simple_addr(&self, addr: &mut SimpleAddr, cur_dot: Dot) -> Option<Dot>

source§

fn map_compound_addr( &self, from: &mut SimpleAddr, to: &mut SimpleAddr, ) -> Option<Dot>

source§

impl Default for CachedStdin

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Edit for CachedStdin

source§

fn contents(&self) -> String

source§

fn insert(&mut self, ix: usize, s: &str)

source§

fn remove(&mut self, from: usize, to: usize)

source§

fn begin_edit_transaction(&mut self)

source§

fn end_edit_transaction(&mut self)

source§

impl IterBoundedChars for CachedStdin

source§

fn rev_iter_between(&self, from: usize, to: usize) -> CharIter<'_>

This will always return None

source§

fn iter_between(&self, from: usize, to: usize) -> CharIter<'_>

Iterate forward: from -> to Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.