pub struct EditorContext<'a> {
pub document: Option<&'a mut EditorDocument>,
pub manager: ExtensionManager,
pub extension_name: String,
}Expand description
Editor context providing access to editor functionality Adapts to available features automatically
Fields§
§document: Option<&'a mut EditorDocument>Current document (if any)
manager: ExtensionManagerAvailable on crate feature
multi-thread only.Reference to the extension manager
extension_name: StringName of the current extension
Trait Implementations§
Source§impl<'a> ExtensionContext for EditorContext<'a>
impl<'a> ExtensionContext for EditorContext<'a>
Source§fn current_document(&self) -> Option<&EditorDocument>
fn current_document(&self) -> Option<&EditorDocument>
Get the current document (if any)
Source§fn current_document_mut(&mut self) -> Option<&mut EditorDocument>
fn current_document_mut(&mut self) -> Option<&mut EditorDocument>
Get a mutable reference to the current document
Source§fn send_event(&mut self, _event: DocumentEvent) -> Result<()>
fn send_event(&mut self, _event: DocumentEvent) -> Result<()>
Send an event to the event system
Source§fn register_command(&mut self, _command: ExtensionCommand) -> Result<()>
fn register_command(&mut self, _command: ExtensionCommand) -> Result<()>
Register a command with the editor
Source§fn show_message(&mut self, _message: &str, _level: MessageLevel) -> Result<()>
fn show_message(&mut self, _message: &str, _level: MessageLevel) -> Result<()>
Show a message to the user
Auto Trait Implementations§
impl<'a> Freeze for EditorContext<'a>
impl<'a> !RefUnwindSafe for EditorContext<'a>
impl<'a> Send for EditorContext<'a>
impl<'a> !Sync for EditorContext<'a>
impl<'a> Unpin for EditorContext<'a>
impl<'a> !UnwindSafe for EditorContext<'a>
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