Struct Layers

Source
pub struct Layers { /* private fields */ }
Expand description

A collection of layers containing scope information.

Implementations§

Source§

impl Layers

Source

pub fn get_merged(&self) -> &Spans<Style>

Source

pub fn add_scopes( &mut self, layer: PluginPid, scopes: Vec<Vec<String>>, style_map: &ThemeStyleMap, )

Adds the provided scopes to the layer’s lookup table.

Source

pub fn update_all(&mut self, delta: &RopeDelta)

Applies the delta to all layers, inserting empty intervals for any regions inserted in the delta.

This is useful for clearing spans, and for updating spans as edits occur.

Source

pub fn update_layer( &mut self, layer: PluginPid, iv: Interval, spans: Spans<u32>, )

Updates the scope spans for a given layer.

Source

pub fn remove_layer(&mut self, layer: PluginPid) -> Option<ScopeLayer>

Removes a given layer. This will remove all styles derived from that layer’s scopes.

Source

pub fn theme_changed(&mut self, style_map: &ThemeStyleMap)

Source

pub fn debug_print_spans(&self, iv: Interval)

Prints scopes and style information for the given Interval.

Trait Implementations§

Source§

impl Default for Layers

Source§

fn default() -> Layers

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Layers

§

impl RefUnwindSafe for Layers

§

impl Send for Layers

§

impl Sync for Layers

§

impl Unpin for Layers

§

impl UnwindSafe for Layers

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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, U> Into<U> for T
where 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.

Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.