pub struct Editor<'language> { /* private fields */ }
Implementations§
Source§impl<'language> Editor<'language>
impl<'language> Editor<'language>
pub fn new( content: String, selector: Selector, language: &'language LanguageCommon, file_path: PathBuf, staged_edit: Option<EditPosition>, ) -> Result<Self>
pub fn from_staged_operation( staged_operation: StagedOperation, language_registry: &'language LanguageRegistry, ) -> Result<Self>
pub fn validate( language: &LanguageCommon, tree: &Tree, content: &str, ) -> Option<String>
pub fn preview(self) -> Result<(String, Option<StagedOperation>)>
pub fn format_code(&self, source: &str) -> Result<String>
pub fn commit(self) -> Result<(String, Option<String>, PathBuf)>
Trait Implementations§
Auto Trait Implementations§
impl<'language> Freeze for Editor<'language>
impl<'language> !RefUnwindSafe for Editor<'language>
impl<'language> Send for Editor<'language>
impl<'language> Sync for Editor<'language>
impl<'language> Unpin for Editor<'language>
impl<'language> !UnwindSafe for Editor<'language>
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