pub struct EditorStateCache {
pub open_buffers: HashMap<DocumentId, OpenBuffer>,
pub active: Option<ActiveSelection>,
}Expand description
Crate-owned snapshot of the editor state the read tools answer from.
Holds no host types — only protocol-level ids / selections / paths.
Mutated solely by the updater task (draining generic events); read by
consumers under the EditorStateHandle mutex.
Fields§
§open_buffers: HashMap<DocumentId, OpenBuffer>Open editor buffers keyed by id.
active: Option<ActiveSelection>The active buffer + selection, if any buffer is active.
Implementations§
Source§impl EditorStateCache
impl EditorStateCache
Sourcepub fn apply_event(&mut self, event: &Event)
pub fn apply_event(&mut self, event: &Event)
Fold one generic editor event into the cache. The subscription filters to the three relevant kinds; the catch-all keeps this a total, defensive match.
Trait Implementations§
Source§impl Debug for EditorStateCache
impl Debug for EditorStateCache
Source§impl Default for EditorStateCache
impl Default for EditorStateCache
Source§fn default() -> EditorStateCache
fn default() -> EditorStateCache
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for EditorStateCache
impl RefUnwindSafe for EditorStateCache
impl Send for EditorStateCache
impl Sync for EditorStateCache
impl Unpin for EditorStateCache
impl UnsafeUnpin for EditorStateCache
impl UnwindSafe for EditorStateCache
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more