pub struct SelectionsCollection {
    pub next_selection_id: usize,
    pub line_mode: bool,
    /* private fields */
}

Fields§

§next_selection_id: usize§line_mode: bool

Implementations§

source§

impl SelectionsCollection

source

pub fn new(display_map: Model<DisplayMap>, buffer: Model<MultiBuffer>) -> Self

source

pub fn display_map(&self, cx: &mut AppContext) -> DisplaySnapshot

source

pub fn clone_state(&mut self, other: &SelectionsCollection)

source

pub fn count(&self) -> usize

source

pub fn disjoint_anchors(&self) -> Arc<[Selection<Anchor>]>

The non-pending, non-overlapping selections. There could still be a pending selection that overlaps these if the mouse is being dragged, etc. Returned as selections over Anchors.

source

pub fn pending_anchor(&self) -> Option<Selection<Anchor>>

source

pub fn pending<D: TextDimension + Ord + Sub<D, Output = D>>( &self, cx: &AppContext ) -> Option<Selection<D>>

source

pub fn pending_mode(&self) -> Option<SelectMode>

source

pub fn all<'a, D>(&self, cx: &AppContext) -> Vec<Selection<D>>where D: 'a + TextDimension + Ord + Sub<D, Output = D> + Debug,

source

pub fn all_adjusted(&self, cx: &mut AppContext) -> Vec<Selection<Point>>

Returns all of the selections, adjusted to take into account the selection line_mode

source

pub fn all_adjusted_display( &self, cx: &mut AppContext ) -> (DisplaySnapshot, Vec<Selection<DisplayPoint>>)

source

pub fn disjoint_in_range<'a, D>( &self, range: Range<Anchor>, cx: &AppContext ) -> Vec<Selection<D>>where D: 'a + TextDimension + Ord + Sub<D, Output = D> + Debug,

source

pub fn all_display( &self, cx: &mut AppContext ) -> (DisplaySnapshot, Vec<Selection<DisplayPoint>>)

source

pub fn newest_anchor(&self) -> &Selection<Anchor>

source

pub fn newest<D: TextDimension + Ord + Sub<D, Output = D>>( &self, cx: &AppContext ) -> Selection<D>

source

pub fn newest_display(&self, cx: &mut AppContext) -> Selection<DisplayPoint>

source

pub fn oldest_anchor(&self) -> &Selection<Anchor>

source

pub fn oldest<D: TextDimension + Ord + Sub<D, Output = D>>( &self, cx: &AppContext ) -> Selection<D>

source

pub fn first_anchor(&self) -> Selection<Anchor>

source

pub fn first<D: TextDimension + Ord + Sub<D, Output = D>>( &self, cx: &AppContext ) -> Selection<D>

source

pub fn last<D: TextDimension + Ord + Sub<D, Output = D>>( &self, cx: &AppContext ) -> Selection<D>

source

pub fn build_columnar_selection( &mut self, display_map: &DisplaySnapshot, row: u32, positions: &Range<Pixels>, reversed: bool, text_layout_details: &TextLayoutDetails ) -> Option<Selection<Point>>

Trait Implementations§

source§

impl Clone for SelectionsCollection

source§

fn clone(&self) -> SelectionsCollection

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SelectionsCollection

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> DynClone for Twhere T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T, U> ToSample<U> for Twhere U: FromSample<T>,

§

fn to_sample_(self) -> U

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
§

impl<S, T> Duplex<S> for Twhere T: FromSample<S> + ToSample<S>,