pub struct DocumentEntry {
pub id: BufferId,
pub handle: Arc<dyn Document>,
}Expand description
Per-document registry payload. Each entry carries the actor
handle plus per-document tree-sitter Syntax state, fold
list, and any other “lives with this buffer until it
closes” state.
Active vs inactive split. The currently-active buffer’s
syntax / folds slots are conventionally None / empty
because the live state lives on App.syntax / App.folds
for hot-path access. Switching buffers via
App::activate_document snapshots the old buffer’s live
state into its entry, then loads the destination’s state
from its entry into the App’s hot-path fields. The
App::activate_buffer_state hook then refreshes anything
that needs recomputing for the newly-active buffer (e.g.
fold recompute when switching into a buffer for the first
time).
Fields§
§id: BufferId§handle: Arc<dyn Document>M.0 (2026-05-31): typed as Arc<dyn Document> so the
registry can hold either a regular RopeDocumentHandle
(today) or a MultibufferDocumentHandle (M.1) without
kind-branching at retrieval. Consumers read through
the Document trait directly; concrete-type access
(e.g., RopeDocumentHandle::replace-equivalent operations
that don’t apply to multibuffer) is gone — slot
replacement / membership APIs handle those cases.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for DocumentEntry
impl !UnwindSafe for DocumentEntry
impl Freeze for DocumentEntry
impl Send for DocumentEntry
impl Sync for DocumentEntry
impl Unpin for DocumentEntry
impl UnsafeUnpin for DocumentEntry
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§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> ⓘ
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> ⓘ
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