Struct Editor

Source
pub struct Editor { /* private fields */ }

Implementations§

Source§

impl Editor

Source

pub fn new() -> Editor

Creates a new Editor with a new empty buffer.

Source

pub fn with_text<T: Into<Rope>>(text: T) -> Editor

Creates a new Editor, loading text into a new buffer.

Source

pub fn reload(&mut self, text: Rope)

Sets this Editor’s contents to text, preserving undo state and cursor position when possible.

Source

pub fn increment_revs_in_flight(&mut self)

Source

pub fn dec_revs_in_flight(&mut self)

Source

pub fn apply_plugin_edit(&mut self, edit: PluginEdit)

generates a delta from a plugin’s response and applies it to the buffer.

Source

pub fn merge_new_state(&mut self, new_engine: Engine)

Source

pub fn set_session_id(&mut self, session: (u64, u32))

See Engine::set_session_id. Only useful for Fuchsia sync.

Source

pub fn sync_state_changed(&mut self)

Source

pub fn theme_changed(&mut self, style_map: &ThemeStyleMap)

Source

pub fn plugin_n_lines(&self) -> usize

Source

pub fn update_spans( &mut self, view: &mut View, plugin: PluginId, start: usize, len: usize, spans: Vec<ScopeSpan>, rev: RevToken, )

Source

pub fn update_annotations( &mut self, view: &mut View, plugin: PluginId, start: usize, len: usize, annotation_spans: Vec<DataSpan>, annotation_type: AnnotationType, rev: RevToken, )

Source

pub fn plugin_get_data( &self, start: usize, unit: TextUnit, max_size: usize, rev: RevToken, ) -> Option<GetDataResponse>

Auto Trait Implementations§

§

impl Freeze for Editor

§

impl RefUnwindSafe for Editor

§

impl Send for Editor

§

impl Sync for Editor

§

impl Unpin for Editor

§

impl UnwindSafe for Editor

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.