Struct multi_buffer2::MultiBuffer
source · pub struct MultiBuffer { /* private fields */ }
Implementations§
source§impl MultiBuffer
impl MultiBuffer
pub fn new(replica_id: ReplicaId) -> Self
pub fn clone(&self, new_cx: &mut ModelContext<'_, Self>) -> Self
pub fn with_title(self, title: String) -> Self
pub fn singleton(buffer: Model<Buffer>, cx: &mut ModelContext<'_, Self>) -> Self
pub fn replica_id(&self) -> ReplicaId
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: ToOffset>( &self, offset: T, theme: Option<&SyntaxTheme>, cx: &AppContext ) -> Option<(u64, Vec<OutlineItem<Anchor>>)>
pub fn edit<I, S, T>( &mut self, edits: I, autoindent_mode: Option<AutoindentMode>, cx: &mut ModelContext<'_, Self> )where I: IntoIterator<Item = (Range<S>, T)>, S: ToOffset, T: Into<Arc<str>>,
pub fn start_transaction( &mut self, cx: &mut ModelContext<'_, Self> ) -> Option<TransactionId>
pub fn start_transaction_at( &mut self, now: Instant, cx: &mut ModelContext<'_, Self> ) -> Option<TransactionId>
pub fn end_transaction( &mut self, cx: &mut ModelContext<'_, Self> ) -> Option<TransactionId>
pub fn end_transaction_at( &mut self, now: Instant, cx: &mut ModelContext<'_, Self> ) -> Option<TransactionId>
pub fn merge_transactions( &mut self, transaction: TransactionId, destination: TransactionId, cx: &mut ModelContext<'_, Self> )
pub fn finalize_last_transaction(&mut self, cx: &mut ModelContext<'_, Self>)
pub fn push_transaction<'a, T>( &mut self, buffer_transactions: T, cx: &mut ModelContext<'_, Self> )where T: IntoIterator<Item = (&'a Model<Buffer>, &'a Transaction)>,
pub fn group_until_transaction( &mut self, transaction_id: TransactionId, cx: &mut ModelContext<'_, Self> )
pub fn set_active_selections( &mut self, selections: &[Selection<Anchor>], line_mode: bool, cursor_shape: CursorShape, cx: &mut ModelContext<'_, Self> )
pub fn remove_active_selections(&mut self, cx: &mut ModelContext<'_, Self>)
pub fn undo(&mut self, cx: &mut ModelContext<'_, Self>) -> Option<TransactionId>
pub fn redo(&mut self, cx: &mut ModelContext<'_, Self>) -> Option<TransactionId>
pub fn undo_transaction( &mut self, transaction_id: TransactionId, cx: &mut ModelContext<'_, Self> )
pub fn stream_excerpts_with_context_lines( &mut self, buffer: Model<Buffer>, ranges: Vec<Range<Anchor>>, context_line_count: u32, cx: &mut ModelContext<'_, Self> ) -> Receiver<Range<Anchor>>
pub fn push_excerpts<O>( &mut self, buffer: Model<Buffer>, ranges: impl IntoIterator<Item = ExcerptRange<O>>, cx: &mut ModelContext<'_, Self> ) -> Vec<ExcerptId>where O: ToOffset,
pub fn push_excerpts_with_context_lines<O>( &mut self, buffer: Model<Buffer>, ranges: Vec<Range<O>>, context_line_count: u32, cx: &mut ModelContext<'_, Self> ) -> Vec<Range<Anchor>>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<'_, Self> ) -> Vec<ExcerptId>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<'_, Self> )where O: ToOffset,
pub fn clear(&mut self, cx: &mut ModelContext<'_, Self>)
pub fn excerpts_for_buffer( &self, buffer: &Model<Buffer>, cx: &AppContext ) -> Vec<(ExcerptId, ExcerptRange<Anchor>)>
pub fn excerpt_ids(&self) -> Vec<ExcerptId>
pub fn excerpt_containing( &self, position: impl ToOffset, cx: &AppContext ) -> Option<(ExcerptId, Model<Buffer>, Range<Anchor>)>
pub fn point_to_buffer_offset<T: ToOffset>( &self, point: T, cx: &AppContext ) -> Option<(Model<Buffer>, usize, ExcerptId)>
pub fn range_to_buffer_ranges<T: ToOffset>( &self, range: Range<T>, cx: &AppContext ) -> Vec<(Model<Buffer>, Range<usize>, ExcerptId)>
pub fn remove_excerpts( &mut self, excerpt_ids: impl IntoIterator<Item = ExcerptId>, cx: &mut ModelContext<'_, Self> )
pub fn wait_for_anchors<'a>( &self, anchors: impl 'a + Iterator<Item = Anchor>, cx: &mut ModelContext<'_, Self> ) -> impl 'static + Future<Output = Result<()>>
pub fn text_anchor_for_position<T: ToOffset>( &self, position: T, cx: &AppContext ) -> Option<(Model<Buffer>, Anchor)>
pub fn all_buffers(&self) -> HashSet<Model<Buffer>>
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<'a, T: ToOffset>( &self, point: T, cx: &'a AppContext ) -> Option<Arc<Language>>
pub fn settings_at<'a, T: ToOffset>( &self, point: T, cx: &'a AppContext ) -> &'a LanguageSettings
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