Struct text_editor::Buffer[][src]

pub struct Buffer {
    pub version: Global,
    // some fields omitted
}

Fields

version: Global

Implementations

impl Buffer[src]

pub fn new<T>(base_text: T) -> Self where
    T: Into<Text>, 
[src]

pub fn version(&self) -> Global[src]

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

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

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

pub fn max_point(&self) -> Point[src]

pub fn len_for_row(&self, row: u32) -> Result<u32, Error>[src]

pub fn longest_row(&self) -> u32[src]

pub fn iter_at_point(&self, point: Point) -> Iter[src]

pub fn line(&self, row: u32) -> Result<Vec<u8>, Error>[src]

pub fn iter(&self) -> Iter[src]

pub fn changes_since(&self, since: Global) -> impl Iterator<Item = Change>[src]

pub fn edit<I, T>(
    &mut self,
    old_ranges: I,
    new_text: T,
    local_clock: &mut Local,
    lamport_clock: &mut Lamport
) -> Vec<Operation> where
    I: IntoIterator<Item = Range<usize>>,
    T: Into<Text>, 
[src]

pub fn edit_2d<I, T>(
    &mut self,
    old_2d_ranges: I,
    new_text: T,
    local_clock: &mut Local,
    lamport_clock: &mut Lamport
) -> Vec<Operation> where
    I: IntoIterator<Item = Range<Point>>,
    T: Into<Text>, 
[src]

pub fn add_selection_set(
    &mut self,
    user_id: UserId,
    selections: Vec<Selection>,
    local_clock: &mut Local
) -> Local
[src]

pub fn offset_for_anchor(&self, anchor: &Anchor) -> Result<usize, Error>[src]

pub fn point_for_anchor(&self, anchor: &Anchor) -> Result<Point, Error>[src]

pub fn cmp_anchors(&self, a: &Anchor, b: &Anchor) -> Result<Ordering, Error>[src]

pub fn remove_selection_set(&mut self, id: Local) -> Result<(), Error>[src]

pub fn selections(&self, set_id: Local) -> Result<&[Selection], Error>[src]

pub fn mutate_selections<F>(&mut self, set_id: Local, f: F) -> Result<(), Error> where
    F: FnOnce(&Buffer, &mut Vec<Selection>), 
[src]

pub fn insert_selections<F>(&mut self, set_id: Local, f: F) -> Result<(), Error> where
    F: FnOnce(&Buffer, &[Selection]) -> Vec<Selection>, 
[src]

pub fn apply_ops<I>(
    &mut self,
    ops: I,
    local_clock: &mut Local,
    lamport_clock: &mut Lamport
) -> Result<(), Error> where
    I: IntoIterator<Item = Operation>, 
[src]

pub fn anchor_before_offset(&self, offset: usize) -> Result<Anchor, Error>[src]

pub fn anchor_after_offset(&self, offset: usize) -> Result<Anchor, Error>[src]

pub fn anchor_before_point(&self, point: Point) -> Result<Anchor, Error>[src]

pub fn anchor_after_point(&self, point: Point) -> Result<Anchor, Error>[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

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.