Struct SemanticEditTools

Source
pub struct SemanticEditTools { /* private fields */ }
Expand description

Semantic editing tools with session support

Implementations§

Source§

impl SemanticEditTools

Source

pub fn session_store(&self) -> &SessionStore<SemanticEditSessionData>

Source

pub fn session_store_mut( &mut self, ) -> &mut SessionStore<SemanticEditSessionData>

Source

pub fn language_registry(&self) -> &LanguageRegistry

Source

pub fn file_cache(&self) -> &Mutex<LruCache<String, String>>

Source

pub fn commit_fn(&self) -> &Option<Box<dyn Fn(PathBuf, String) + 'static>>

Source

pub fn commit_fn_mut( &mut self, ) -> &mut Option<Box<dyn Fn(PathBuf, String) + 'static>>

Source

pub fn set_commit_fn( &mut self, commit_fn: Option<Box<dyn Fn(PathBuf, String) + 'static>>, ) -> &mut Self

Source

pub fn default_session_id(&self) -> &'static str

Source

pub fn set_default_session_id( &mut self, default_session_id: &'static str, ) -> &mut Self

Source

pub fn with_default_session_id(self, default_session_id: &'static str) -> Self

Source§

impl SemanticEditTools

Source

pub fn new(storage_path: Option<&str>) -> Result<Self>

Create a new SemanticEditTools instance

Source

pub fn get_context(&self, session_id: Option<&str>) -> Result<Option<PathBuf>>

Get context for a session

Source

pub fn stage_operation( &self, session_id: Option<&str>, staged_operation: Option<StagedOperation>, ) -> Result<()>

Stage a new operation, replacing any existing staged operation

Source

pub fn get_staged_operation( &self, session_id: Option<&str>, ) -> Result<Option<StagedOperation>>

Get the currently staged operation, if any

Source

pub fn take_staged_operation( &self, session_id: Option<&str>, ) -> Result<Option<StagedOperation>>

Take the staged operation, removing it from storage

Source

pub fn modify_staged_operation<F>( &self, session_id: Option<&str>, fun: F, ) -> Result<Option<StagedOperation>>
where F: FnOnce(&mut StagedOperation),

Modify the staged operation in place

Source

pub fn set_context(&self, session_id: Option<&str>, path: PathBuf) -> Result<()>

Set context path for a session

Trait Implementations§

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, U> ExactFrom<T> for U
where U: TryFrom<T>,

Source§

fn exact_from(value: T) -> U

Source§

impl<T, U> ExactInto<U> for T
where U: ExactFrom<T>,

Source§

fn exact_into(self) -> U

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T, U> OverflowingInto<U> for T
where U: OverflowingFrom<T>,

Source§

impl<T, U> RoundingInto<U> for T
where U: RoundingFrom<T>,

Source§

impl<T, U> SaturatingInto<U> for T
where U: SaturatingFrom<T>,

Source§

impl<T> ToDebugString for T
where T: Debug,

Source§

fn to_debug_string(&self) -> String

Returns the String produced by Ts Debug implementation.

§Examples
use malachite_base::strings::ToDebugString;

assert_eq!([1, 2, 3].to_debug_string(), "[1, 2, 3]");
assert_eq!(
    [vec![2, 3], vec![], vec![4]].to_debug_string(),
    "[[2, 3], [], [4]]"
);
assert_eq!(Some(5).to_debug_string(), "Some(5)");
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T, U> WrappingInto<U> for T
where U: WrappingFrom<T>,

Source§

fn wrapping_into(self) -> U