Struct printer::buffer::Buffer[][src]

pub struct Buffer {
    pub buffer: Vec<char>,
    pub buffer_pos: usize,
}

Fields

buffer: Vec<char>buffer_pos: usize

Implementations

impl Buffer[src]

pub fn new() -> Self[src]

pub fn insert(&mut self, c: char)[src]

pub fn insert_str(&mut self, s: &str)[src]

pub fn set_buffer_pos(&mut self, pos: usize)[src]

pub fn remove_current_char(&mut self) -> Option<char>[src]

pub fn next_char(&self) -> Option<&char>[src]

pub fn current_char(&self) -> Option<&char>[src]

pub fn previous_char(&self) -> Option<&char>[src]

pub fn move_forward(&mut self)[src]

pub fn move_backward(&mut self)[src]

pub fn clear(&mut self)[src]

pub fn len(&self) -> usize[src]

pub fn is_empty(&self) -> bool[src]

pub fn is_at_string_line_start(&self) -> bool[src]

pub fn is_at_start(&self) -> bool[src]

pub fn is_at_end(&self) -> bool[src]

pub fn goto_start(&mut self)[src]

pub fn goto_end(&mut self)[src]

pub fn _push_str(&mut self, str: &str)[src]

pub fn get(&self, idx: usize) -> Option<&char>[src]

pub fn _last(&self) -> Option<&char>[src]

pub fn iter(&self) -> impl Iterator<Item = &char>[src]

pub fn take(&mut self) -> Vec<char>[src]

Trait Implementations

impl Clone for Buffer[src]

fn clone(&self) -> Buffer[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Default for Buffer[src]

fn default() -> Buffer[src]

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

impl From<&'_ str> for Buffer[src]

fn from(string: &str) -> Self[src]

Performs the conversion.

impl From<String> for Buffer[src]

fn from(string: String) -> Self[src]

Performs the conversion.

impl From<Vec<char, Global>> for Buffer[src]

fn from(buffer: Vec<char>) -> Self[src]

Performs the conversion.

impl FromIterator<char> for Buffer[src]

fn from_iter<I: IntoIterator<Item = char>>(iter: I) -> Buffer[src]

Creates a value from an iterator. Read more

impl ToString for Buffer[src]

fn to_string(&self) -> String[src]

Converts the given value to a String. Read more

Auto Trait Implementations

impl RefUnwindSafe for Buffer

impl Send for Buffer

impl Sync for Buffer

impl Unpin for Buffer

impl UnwindSafe for Buffer

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.