pub struct SnippetSession { /* private fields */ }Expand description
An active snippet session tracked in document coordinates.
This is a view-local editing state: it is expected to be stored alongside cursor/selection
state (e.g. per ViewId in a Workspace).
Implementations§
Source§impl SnippetSession
impl SnippetSession
Sourcepub fn new(insert_start: usize, template: &SnippetTemplate) -> Option<Self>
pub fn new(insert_start: usize, template: &SnippetTemplate) -> Option<Self>
Create a snippet session for an inserted template.
insert_startis the character offset wheretemplate.textbegins in the document.- Returns
Nonewhentemplatecontains no tabstops (nothing to navigate).
Sourcepub fn apply_delta(&mut self, delta: &TextDelta)
pub fn apply_delta(&mut self, delta: &TextDelta)
Shift all tracked placeholder/final offsets through a document text delta.
Trait Implementations§
Source§impl Clone for SnippetSession
impl Clone for SnippetSession
Source§fn clone(&self) -> SnippetSession
fn clone(&self) -> SnippetSession
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SnippetSession
impl Debug for SnippetSession
impl Eq for SnippetSession
Source§impl PartialEq for SnippetSession
impl PartialEq for SnippetSession
Source§fn eq(&self, other: &SnippetSession) -> bool
fn eq(&self, other: &SnippetSession) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for SnippetSession
Auto Trait Implementations§
impl Freeze for SnippetSession
impl RefUnwindSafe for SnippetSession
impl Send for SnippetSession
impl Sync for SnippetSession
impl Unpin for SnippetSession
impl UnsafeUnpin for SnippetSession
impl UnwindSafe for SnippetSession
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