Struct editor2::MultiBuffer
source · pub struct MultiBuffer { /* private fields */ }
Implementations§
source§impl MultiBuffer
impl MultiBuffer
pub fn new(replica_id: u16) -> MultiBuffer
pub fn clone(&self, new_cx: &mut ModelContext<'_, MultiBuffer>) -> MultiBuffer
pub fn with_title(self, title: String) -> MultiBuffer
pub fn singleton( buffer: Model<Buffer>, cx: &mut ModelContext<'_, MultiBuffer> ) -> MultiBuffer
pub fn replica_id(&self) -> u16
pub fn snapshot(&self, cx: &AppContext) -> MultiBufferSnapshot
pub fn read(&self, cx: &AppContext) -> Ref<'_, MultiBufferSnapshot>
pub fn as_singleton(&self) -> Option<Model<Buffer>>
pub fn is_singleton(&self) -> bool
pub fn subscribe(&mut self) -> Subscription
pub fn is_dirty(&self, cx: &AppContext) -> bool
pub fn has_conflict(&self, cx: &AppContext) -> bool
pub fn len(&self, cx: &AppContext) -> usize
pub fn is_empty(&self, cx: &AppContext) -> bool
pub fn symbols_containing<T>( &self, offset: T, theme: Option<&SyntaxTheme>, cx: &AppContext ) -> Option<(u64, Vec<OutlineItem<Anchor>, Global>)>where T: ToOffset,
pub fn edit<I, S, T>( &mut self, edits: I, autoindent_mode: Option<AutoindentMode>, cx: &mut ModelContext<'_, MultiBuffer> )where I: IntoIterator<Item = (Range<S>, T)>, S: ToOffset, T: Into<Arc<str, Global>>,
pub fn start_transaction( &mut self, cx: &mut ModelContext<'_, MultiBuffer> ) -> Option<Lamport>
pub fn start_transaction_at( &mut self, now: Instant, cx: &mut ModelContext<'_, MultiBuffer> ) -> Option<Lamport>
pub fn end_transaction( &mut self, cx: &mut ModelContext<'_, MultiBuffer> ) -> Option<Lamport>
pub fn end_transaction_at( &mut self, now: Instant, cx: &mut ModelContext<'_, MultiBuffer> ) -> Option<Lamport>
pub fn merge_transactions( &mut self, transaction: Lamport, destination: Lamport, cx: &mut ModelContext<'_, MultiBuffer> )
pub fn finalize_last_transaction( &mut self, cx: &mut ModelContext<'_, MultiBuffer> )
pub fn push_transaction<'a, T>( &mut self, buffer_transactions: T, cx: &mut ModelContext<'_, MultiBuffer> )where T: IntoIterator<Item = (&'a Model<Buffer>, &'a Transaction)>,
pub fn group_until_transaction( &mut self, transaction_id: Lamport, cx: &mut ModelContext<'_, MultiBuffer> )
pub fn set_active_selections( &mut self, selections: &[Selection<Anchor>], line_mode: bool, cursor_shape: CursorShape, cx: &mut ModelContext<'_, MultiBuffer> )
pub fn remove_active_selections( &mut self, cx: &mut ModelContext<'_, MultiBuffer> )
pub fn undo( &mut self, cx: &mut ModelContext<'_, MultiBuffer> ) -> Option<Lamport>
pub fn redo( &mut self, cx: &mut ModelContext<'_, MultiBuffer> ) -> Option<Lamport>
pub fn undo_transaction( &mut self, transaction_id: Lamport, cx: &mut ModelContext<'_, MultiBuffer> )
pub fn stream_excerpts_with_context_lines( &mut self, buffer: Model<Buffer>, ranges: Vec<Range<Anchor>, Global>, context_line_count: u32, cx: &mut ModelContext<'_, MultiBuffer> ) -> Receiver<Range<Anchor>>
pub fn push_excerpts<O>( &mut self, buffer: Model<Buffer>, ranges: impl IntoIterator<Item = ExcerptRange<O>>, cx: &mut ModelContext<'_, MultiBuffer> ) -> Vec<ExcerptId, Global>where O: ToOffset,
pub fn push_excerpts_with_context_lines<O>( &mut self, buffer: Model<Buffer>, ranges: Vec<Range<O>, Global>, context_line_count: u32, cx: &mut ModelContext<'_, MultiBuffer> ) -> Vec<Range<Anchor>, Global>where O: ToPoint + ToOffset,
pub fn insert_excerpts_after<O>( &mut self, prev_excerpt_id: ExcerptId, buffer: Model<Buffer>, ranges: impl IntoIterator<Item = ExcerptRange<O>>, cx: &mut ModelContext<'_, MultiBuffer> ) -> Vec<ExcerptId, Global>where O: ToOffset,
pub fn insert_excerpts_with_ids_after<O>( &mut self, prev_excerpt_id: ExcerptId, buffer: Model<Buffer>, ranges: impl IntoIterator<Item = (ExcerptId, ExcerptRange<O>)>, cx: &mut ModelContext<'_, MultiBuffer> )where O: ToOffset,
pub fn clear(&mut self, cx: &mut ModelContext<'_, MultiBuffer>)
pub fn excerpts_for_buffer( &self, buffer: &Model<Buffer>, cx: &AppContext ) -> Vec<(ExcerptId, ExcerptRange<Anchor>), Global>
pub fn excerpt_ids(&self) -> Vec<ExcerptId, Global>
pub fn excerpt_containing( &self, position: impl ToOffset, cx: &AppContext ) -> Option<(ExcerptId, Model<Buffer>, Range<Anchor>)>
pub fn point_to_buffer_offset<T>( &self, point: T, cx: &AppContext ) -> Option<(Model<Buffer>, usize, ExcerptId)>where T: ToOffset,
pub fn range_to_buffer_ranges<T>( &self, range: Range<T>, cx: &AppContext ) -> Vec<(Model<Buffer>, Range<usize>, ExcerptId), Global>where T: ToOffset,
pub fn remove_excerpts( &mut self, excerpt_ids: impl IntoIterator<Item = ExcerptId>, cx: &mut ModelContext<'_, MultiBuffer> )
pub fn wait_for_anchors<'a>( &self, anchors: impl Iterator<Item = Anchor> + 'a, cx: &mut ModelContext<'_, MultiBuffer> ) -> impl Future<Output = Result<(), Error>> + 'static
pub fn text_anchor_for_position<T>( &self, position: T, cx: &AppContext ) -> Option<(Model<Buffer>, Anchor)>where T: ToOffset,
pub fn all_buffers(&self) -> HashSet<Model<Buffer>, RandomState>
pub fn buffer(&self, buffer_id: u64) -> Option<Model<Buffer>>
pub fn is_completion_trigger( &self, position: Anchor, text: &str, cx: &AppContext ) -> bool
pub fn language_at<T, 'a>( &self, point: T, cx: &'a AppContext ) -> Option<Arc<Language, Global>>where T: ToOffset,
pub fn settings_at<T, 'a>( &self, point: T, cx: &'a AppContext ) -> &'a LanguageSettingswhere T: ToOffset,
pub fn for_each_buffer(&self, f: impl FnMut(&Model<Buffer>))
pub fn title<'a>(&'a self, cx: &'a AppContext) -> Cow<'a, str>
Trait Implementations§
impl EventEmitter<Event> for MultiBuffer
Auto Trait Implementations§
impl !RefUnwindSafe for MultiBuffer
impl !Send for MultiBuffer
impl !Sync for MultiBuffer
impl Unpin for MultiBuffer
impl !UnwindSafe for MultiBuffer
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