pub struct RenderedSnippet {
pub text: String,
pub tabstops: Vec<TabstopRange>,
pub exit_index: Option<usize>,
}Expand description
Output of render. Contains the literal text the editor
inserts plus the tabstop ranges grouped by index for easy
navigation.
Fields§
§text: StringText the editor splices into the buffer.
tabstops: Vec<TabstopRange>All tabstop ranges in render order ($1’s ranges
before $2’s, etc.).
exit_index: Option<usize>Index of the $0 (exit) tabstop in tabstops, when
the body included one.
Implementations§
Source§impl RenderedSnippet
impl RenderedSnippet
Sourcepub fn grouped_by_index(&self) -> BTreeMap<u32, Vec<&TabstopRange>>
pub fn grouped_by_index(&self) -> BTreeMap<u32, Vec<&TabstopRange>>
Group tabstop ranges by index. Returns a sorted map so
the host can iterate $1 -> $2 -> … -> $0 in
order, with each group containing all mirrors for that
index.
Trait Implementations§
Source§impl Clone for RenderedSnippet
impl Clone for RenderedSnippet
Source§fn clone(&self) -> RenderedSnippet
fn clone(&self) -> RenderedSnippet
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 moreAuto Trait Implementations§
impl Freeze for RenderedSnippet
impl RefUnwindSafe for RenderedSnippet
impl Send for RenderedSnippet
impl Sync for RenderedSnippet
impl Unpin for RenderedSnippet
impl UnsafeUnpin for RenderedSnippet
impl UnwindSafe for RenderedSnippet
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