Skip to main content

VirtualRowProviderRegistry

Struct VirtualRowProviderRegistry 

Source
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

Source

pub fn new() -> Self

Source

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.

Source

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”.

Source

pub fn snapshot(&self, buffer_id: BufferId) -> Vec<Arc<dyn VirtualRowProvider>>

Snapshot providers registered against buffer_id. Returns fresh Arc clones — callers can hold them past a concurrent unregister (RCU). Order is unspecified. Returns an empty Vec if the buffer has no scope.

Source

pub fn is_empty(&self) -> bool

True iff no buffer scope holds any provider.

Source

pub fn len(&self) -> usize

Total provider count across all buffer scopes.

Trait Implementations§

Source§

impl Debug for VirtualRowProviderRegistry

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for VirtualRowProviderRegistry

Source§

fn default() -> VirtualRowProviderRegistry

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

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

Register 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

Remove the provider identified by id from buffer’s scope.

Auto Trait Implementations§

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &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
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

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 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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
§

impl<T> IntoMaybeUndefined<T> for T

§

fn into_maybe_undefined(self) -> MaybeUndefined<T>

Converts this value into a three-state builder argument.
§

impl<T> IntoOption<T> for T

§

fn into_option(self) -> Option<T>

Converts this value into an optional builder argument.
§

impl<T> Pointable for T

§

const ALIGN: usize

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
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( pointer: <T as Pointee>::Pointer, f: &mut Formatter<'_>, ) -> Result<(), Error>

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more