pub struct VirtualRowProviderRegistry { /* private fields */ }Expand description
Process-wide registry of VirtualRowProvider instances,
scoped per BufferId (D.4.d.2.1.a).
Each visible buffer that participates in the virtual-rows
pipeline owns its own ProviderId → provider sub-map.
Scoping by BufferId is what lets baseline + current
panes of a side-by-side diff (D.4.d.3) both register
filler providers (D.4.c) without colliding on
ProviderId, even though the filler ids use side-
distinct prefixes — registering against the wrong
scope would still mis-route the rows when the worker
(post-D.4.d.2.1.b) iterates per-pane.
Mutation (register / unregister) is consumer-creation
frequency — never per-frame. Read (snapshot) is per
worker tick. Behind a std::sync::Mutex; the hot path
holds the lock only long enough to clone out Arc
references.
Implementations§
Source§impl VirtualRowProviderRegistry
impl VirtualRowProviderRegistry
pub fn new() -> Self
Sourcepub fn register(
&self,
buffer_id: BufferId,
provider: Arc<dyn VirtualRowProvider>,
) -> bool
pub fn register( &self, buffer_id: BufferId, provider: Arc<dyn VirtualRowProvider>, ) -> bool
Register a provider against buffer_id. Returns false
if a provider with the same id was already registered in
the same buffer scope (no replacement — the caller is
expected to unregister first). Providers with the same
id in different buffer scopes do not collide.
Sourcepub fn unregister(&self, buffer_id: BufferId, id: ProviderId) -> bool
pub fn unregister(&self, buffer_id: BufferId, id: ProviderId) -> bool
Remove a provider from buffer_id’s scope. Returns
true if one was removed. Empty scopes are pruned so
is_empty() reflects “no providers anywhere”.
Trait Implementations§
Source§impl Debug for VirtualRowProviderRegistry
impl Debug for VirtualRowProviderRegistry
Source§impl Default for VirtualRowProviderRegistry
impl Default for VirtualRowProviderRegistry
Source§fn default() -> VirtualRowProviderRegistry
fn default() -> VirtualRowProviderRegistry
Source§impl VirtualRowRegistrar for VirtualRowProviderRegistry
AUX‑2: bridge so subsystems without access to
VirtualRowProviderRegistry can register headerlines.
impl VirtualRowRegistrar for VirtualRowProviderRegistry
AUX‑2: bridge so subsystems without access to
VirtualRowProviderRegistry can register headerlines.
Source§fn register(
&self,
buffer: BufferId,
provider: Arc<dyn VirtualRowProvider>,
) -> bool
fn register( &self, buffer: BufferId, provider: Arc<dyn VirtualRowProvider>, ) -> bool
provider against buffer. Returns false if a provider with
the same ProviderId is already registered in the same buffer scope.Source§fn unregister(&self, buffer: BufferId, id: ProviderId) -> bool
fn unregister(&self, buffer: BufferId, id: ProviderId) -> bool
id from buffer’s scope.Auto Trait Implementations§
impl !Freeze for VirtualRowProviderRegistry
impl RefUnwindSafe for VirtualRowProviderRegistry
impl Send for VirtualRowProviderRegistry
impl Sync for VirtualRowProviderRegistry
impl Unpin for VirtualRowProviderRegistry
impl UnsafeUnpin for VirtualRowProviderRegistry
impl UnwindSafe for VirtualRowProviderRegistry
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