Struct editor2::MultiBufferSnapshot
source · pub struct MultiBufferSnapshot { /* private fields */ }
Implementations§
source§impl MultiBufferSnapshot
impl MultiBufferSnapshot
pub fn text(&self) -> String
pub fn reversed_chars_at<T>(&self, position: T) -> impl Iterator<Item = char>where T: ToOffset,
pub fn chars_at<T>(&self, position: T) -> impl Iterator<Item = char>where T: ToOffset,
pub fn text_for_range<T>(&self, range: Range<T>) -> impl Iterator<Item = &str>where T: ToOffset,
pub fn is_line_blank(&self, row: u32) -> bool
pub fn contains_str_at<T>(&self, position: T, needle: &str) -> boolwhere T: ToOffset,
pub fn surrounding_word<T>(&self, start: T) -> (Range<usize>, Option<CharKind>)where T: ToOffset,
pub fn as_singleton(&self) -> Option<(&ExcerptId, u64, &BufferSnapshot)>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn max_buffer_row(&self) -> u32
pub fn clip_offset(&self, offset: usize, bias: Bias) -> usize
pub fn clip_point(&self, point: Point, bias: Bias) -> Point
pub fn clip_offset_utf16(&self, offset: OffsetUtf16, bias: Bias) -> OffsetUtf16
pub fn clip_point_utf16( &self, point: Unclipped<PointUtf16>, bias: Bias ) -> PointUtf16
pub fn bytes_in_range<T>(&self, range: Range<T>) -> MultiBufferBytes<'_>where T: ToOffset,
pub fn reversed_bytes_in_range<T>( &self, range: Range<T> ) -> ReversedMultiBufferBytes<'_>where T: ToOffset,
pub fn buffer_rows(&self, start_row: u32) -> MultiBufferRows<'_>
pub fn chunks<T>( &self, range: Range<T>, language_aware: bool ) -> MultiBufferChunks<'_>where T: ToOffset,
pub fn offset_to_point(&self, offset: usize) -> Point
pub fn offset_to_point_utf16(&self, offset: usize) -> PointUtf16
pub fn point_to_point_utf16(&self, point: Point) -> PointUtf16
pub fn point_to_offset(&self, point: Point) -> usize
pub fn offset_utf16_to_offset(&self, offset_utf16: OffsetUtf16) -> usize
pub fn offset_to_offset_utf16(&self, offset: usize) -> OffsetUtf16
pub fn point_utf16_to_offset(&self, point: PointUtf16) -> usize
pub fn point_to_buffer_offset<T>( &self, point: T ) -> Option<(&BufferSnapshot, usize)>where T: ToOffset,
pub fn suggested_indents( &self, rows: impl IntoIterator<Item = u32>, cx: &AppContext ) -> BTreeMap<u32, IndentSize, Global>
pub fn indent_size_for_line(&self, row: u32) -> IndentSize
pub fn prev_non_blank_row(&self, row: u32) -> Option<u32>
pub fn line_len(&self, row: u32) -> u32
pub fn buffer_line_for_row( &self, row: u32 ) -> Option<(&BufferSnapshot, Range<Point>)>
pub fn max_point(&self) -> Point
pub fn text_summary(&self) -> TextSummary
pub fn text_summary_for_range<D, O>(&self, range: Range<O>) -> Dwhere D: TextDimension, O: ToOffset,
pub fn summary_for_anchor<D>(&self, anchor: &Anchor) -> Dwhere D: TextDimension + Ord + Sub<D, Output = D>,
pub fn summaries_for_anchors<'a, D, I>(&'a self, anchors: I) -> Vec<D, Global>where D: TextDimension + Ord + Sub<D, Output = D>, I: 'a + IntoIterator<Item = &'a Anchor>,
pub fn refresh_anchors<'a, I>( &'a self, anchors: I ) -> Vec<(usize, Anchor, bool), Global>where I: 'a + IntoIterator<Item = &'a Anchor>,
pub fn anchor_before<T>(&self, position: T) -> Anchorwhere T: ToOffset,
pub fn anchor_after<T>(&self, position: T) -> Anchorwhere T: ToOffset,
pub fn anchor_at<T>(&self, position: T, bias: Bias) -> Anchorwhere T: ToOffset,
pub fn anchor_in_excerpt( &self, excerpt_id: ExcerptId, text_anchor: Anchor ) -> Anchor
pub fn can_resolve(&self, anchor: &Anchor) -> bool
pub fn excerpts( &self ) -> impl Iterator<Item = (ExcerptId, &BufferSnapshot, ExcerptRange<Anchor>)>
pub fn excerpt_boundaries_in_range<R, T>( &self, range: R ) -> impl Iterator<Item = ExcerptBoundary>where R: RangeBounds<T>, T: ToOffset,
pub fn edit_count(&self) -> usize
pub fn parse_count(&self) -> usize
sourcepub fn innermost_enclosing_bracket_ranges<T>(
&self,
range: Range<T>
) -> Option<(Range<usize>, Range<usize>)>where
T: ToOffset,
pub fn innermost_enclosing_bracket_ranges<T>( &self, range: Range<T> ) -> Option<(Range<usize>, Range<usize>)>where T: ToOffset,
Returns the smallest enclosing bracket ranges containing the given range or None if no brackets contain range or the range is not contained in a single excerpt
sourcepub fn enclosing_bracket_ranges<T, 'a>(
&'a self,
range: Range<T>
) -> Option<impl Iterator<Item = (Range<usize>, Range<usize>)> + 'a>where
T: ToOffset,
pub fn enclosing_bracket_ranges<T, 'a>( &'a self, range: Range<T> ) -> Option<impl Iterator<Item = (Range<usize>, Range<usize>)> + 'a>where T: ToOffset,
Returns enclosing bracket ranges containing the given range or returns None if the range is not contained in a single excerpt
sourcepub fn bracket_ranges<T, 'a>(
&'a self,
range: Range<T>
) -> Option<impl Iterator<Item = (Range<usize>, Range<usize>)> + 'a>where
T: ToOffset,
pub fn bracket_ranges<T, 'a>( &'a self, range: Range<T> ) -> Option<impl Iterator<Item = (Range<usize>, Range<usize>)> + 'a>where T: ToOffset,
Returns bracket range pairs overlapping the given range
or returns None if the range
is
not contained in a single excerpt
pub fn diagnostics_update_count(&self) -> usize
pub fn git_diff_update_count(&self) -> usize
pub fn trailing_excerpt_update_count(&self) -> usize
pub fn file_at<T, 'a>(&'a self, point: T) -> Option<&'a Arc<dyn File, Global>>where T: ToOffset,
pub fn language_at<T, 'a>( &'a self, point: T ) -> Option<&'a Arc<Language, Global>>where T: ToOffset,
pub fn settings_at<T, 'a>( &'a self, point: T, cx: &'a AppContext ) -> &'a LanguageSettingswhere T: ToOffset,
pub fn language_scope_at<T, 'a>(&'a self, point: T) -> Option<LanguageScope>where T: ToOffset,
pub fn language_indent_size_at<T>( &self, position: T, cx: &AppContext ) -> Option<IndentSize>where T: ToOffset,
pub fn is_dirty(&self) -> bool
pub fn has_conflict(&self) -> bool
pub fn diagnostic_group<'a, O>( &'a self, group_id: usize ) -> impl Iterator<Item = DiagnosticEntry<O>> + 'awhere O: FromAnchor + 'a,
pub fn diagnostics_in_range<'a, T, O>( &'a self, range: Range<T>, reversed: bool ) -> impl Iterator<Item = DiagnosticEntry<O>> + 'awhere T: 'a + ToOffset, O: 'a + FromAnchor + Ord,
pub fn has_git_diffs(&self) -> bool
pub fn git_diff_hunks_in_range_rev<'a>( &'a self, row_range: Range<u32> ) -> impl Iterator<Item = DiffHunk<u32>> + 'a
pub fn git_diff_hunks_in_range<'a>( &'a self, row_range: Range<u32> ) -> impl Iterator<Item = DiffHunk<u32>> + 'a
pub fn range_for_syntax_ancestor<T>( &self, range: Range<T> ) -> Option<Range<usize>>where T: ToOffset,
pub fn outline(&self, theme: Option<&SyntaxTheme>) -> Option<Outline<Anchor>>
pub fn symbols_containing<T>( &self, offset: T, theme: Option<&SyntaxTheme> ) -> Option<(u64, Vec<OutlineItem<Anchor>, Global>)>where T: ToOffset,
pub fn buffer_id_for_excerpt(&self, excerpt_id: ExcerptId) -> Option<u64>
pub fn buffer_for_excerpt( &self, excerpt_id: ExcerptId ) -> Option<&BufferSnapshot>
pub fn remote_selections_in_range<'a>( &'a self, range: &'a Range<Anchor> ) -> impl Iterator<Item = (u16, bool, CursorShape, Selection<Anchor>)> + 'a
Trait Implementations§
source§impl Clone for MultiBufferSnapshot
impl Clone for MultiBufferSnapshot
source§fn clone(&self) -> MultiBufferSnapshot
fn clone(&self) -> MultiBufferSnapshot
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Default for MultiBufferSnapshot
impl Default for MultiBufferSnapshot
source§fn default() -> MultiBufferSnapshot
fn default() -> MultiBufferSnapshot
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for MultiBufferSnapshot
impl Send for MultiBufferSnapshot
impl Sync for MultiBufferSnapshot
impl Unpin for MultiBufferSnapshot
impl !UnwindSafe for MultiBufferSnapshot
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