pub struct MultiBuffer { /* private fields */ }

Implementations§

source§

impl MultiBuffer

source

pub fn new(replica_id: ReplicaId) -> Self

source

pub fn clone(&self, new_cx: &mut ModelContext<'_, Self>) -> Self

source

pub fn with_title(self, title: String) -> Self

source

pub fn singleton(buffer: Model<Buffer>, cx: &mut ModelContext<'_, Self>) -> Self

source

pub fn replica_id(&self) -> ReplicaId

source

pub fn snapshot(&self, cx: &AppContext) -> MultiBufferSnapshot

source

pub fn read(&self, cx: &AppContext) -> Ref<'_, MultiBufferSnapshot>

source

pub fn as_singleton(&self) -> Option<Model<Buffer>>

source

pub fn is_singleton(&self) -> bool

source

pub fn subscribe(&mut self) -> Subscription

source

pub fn is_dirty(&self, cx: &AppContext) -> bool

source

pub fn has_conflict(&self, cx: &AppContext) -> bool

source

pub fn len(&self, cx: &AppContext) -> usize

source

pub fn is_empty(&self, cx: &AppContext) -> bool

source

pub fn symbols_containing<T: ToOffset>( &self, offset: T, theme: Option<&SyntaxTheme>, cx: &AppContext ) -> Option<(u64, Vec<OutlineItem<Anchor>>)>

source

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>>,

source

pub fn start_transaction( &mut self, cx: &mut ModelContext<'_, Self> ) -> Option<TransactionId>

source

pub fn start_transaction_at( &mut self, now: Instant, cx: &mut ModelContext<'_, Self> ) -> Option<TransactionId>

source

pub fn end_transaction( &mut self, cx: &mut ModelContext<'_, Self> ) -> Option<TransactionId>

source

pub fn end_transaction_at( &mut self, now: Instant, cx: &mut ModelContext<'_, Self> ) -> Option<TransactionId>

source

pub fn merge_transactions( &mut self, transaction: TransactionId, destination: TransactionId, cx: &mut ModelContext<'_, Self> )

source

pub fn finalize_last_transaction(&mut self, cx: &mut ModelContext<'_, Self>)

source

pub fn push_transaction<'a, T>( &mut self, buffer_transactions: T, cx: &mut ModelContext<'_, Self> )where T: IntoIterator<Item = (&'a Model<Buffer>, &'a Transaction)>,

source

pub fn group_until_transaction( &mut self, transaction_id: TransactionId, cx: &mut ModelContext<'_, Self> )

source

pub fn set_active_selections( &mut self, selections: &[Selection<Anchor>], line_mode: bool, cursor_shape: CursorShape, cx: &mut ModelContext<'_, Self> )

source

pub fn remove_active_selections(&mut self, cx: &mut ModelContext<'_, Self>)

source

pub fn undo(&mut self, cx: &mut ModelContext<'_, Self>) -> Option<TransactionId>

source

pub fn redo(&mut self, cx: &mut ModelContext<'_, Self>) -> Option<TransactionId>

source

pub fn undo_transaction( &mut self, transaction_id: TransactionId, cx: &mut ModelContext<'_, Self> )

source

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>>

source

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,

source

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,

source

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,

source

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,

source

pub fn clear(&mut self, cx: &mut ModelContext<'_, Self>)

source

pub fn excerpts_for_buffer( &self, buffer: &Model<Buffer>, cx: &AppContext ) -> Vec<(ExcerptId, ExcerptRange<Anchor>)>

source

pub fn excerpt_ids(&self) -> Vec<ExcerptId>

source

pub fn excerpt_containing( &self, position: impl ToOffset, cx: &AppContext ) -> Option<(ExcerptId, Model<Buffer>, Range<Anchor>)>

source

pub fn point_to_buffer_offset<T: ToOffset>( &self, point: T, cx: &AppContext ) -> Option<(Model<Buffer>, usize, ExcerptId)>

source

pub fn range_to_buffer_ranges<T: ToOffset>( &self, range: Range<T>, cx: &AppContext ) -> Vec<(Model<Buffer>, Range<usize>, ExcerptId)>

source

pub fn remove_excerpts( &mut self, excerpt_ids: impl IntoIterator<Item = ExcerptId>, cx: &mut ModelContext<'_, Self> )

source

pub fn wait_for_anchors<'a>( &self, anchors: impl 'a + Iterator<Item = Anchor>, cx: &mut ModelContext<'_, Self> ) -> impl 'static + Future<Output = Result<()>>

source

pub fn text_anchor_for_position<T: ToOffset>( &self, position: T, cx: &AppContext ) -> Option<(Model<Buffer>, Anchor)>

source

pub fn all_buffers(&self) -> HashSet<Model<Buffer>>

source

pub fn buffer(&self, buffer_id: u64) -> Option<Model<Buffer>>

source

pub fn is_completion_trigger( &self, position: Anchor, text: &str, cx: &AppContext ) -> bool

source

pub fn language_at<'a, T: ToOffset>( &self, point: T, cx: &'a AppContext ) -> Option<Arc<Language>>

source

pub fn settings_at<'a, T: ToOffset>( &self, point: T, cx: &'a AppContext ) -> &'a LanguageSettings

source

pub fn for_each_buffer(&self, f: impl FnMut(&Model<Buffer>))

source

pub fn title<'a>(&'a self, cx: &'a AppContext) -> Cow<'a, str>

Trait Implementations§

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more