pub trait FoldOverlayService: Send + Sync {
// Required methods
fn add_source(
&self,
source: Arc<dyn FoldSource>,
buffer_id: BufferId,
) -> ProviderId;
fn remove_source(&self, id: ProviderId);
}Expand description
Service for registering / deregistering overlay fold sources.
Implemented by FoldOverlayServiceImpl in lattice-host (which
wraps Arc<Mutex<FoldRegistry>>). Registered in the
ServiceRegistry at boot so MultibufferMode::on_activate can
call add_source without depending on lattice-host.
buffer_id scopes the overlay: FoldSourceAdapter in
lattice-host only calls compute_folds when
FoldContext::buffer_id matches, so providers from multiple
simultaneous multibuffers don’t bleed into each other’s views.
Slice: M.7.
Required Methods§
Sourcefn add_source(
&self,
source: Arc<dyn FoldSource>,
buffer_id: BufferId,
) -> ProviderId
fn add_source( &self, source: Arc<dyn FoldSource>, buffer_id: BufferId, ) -> ProviderId
Register source as an overlay provider scoped to buffer_id and
return the id to pass to Self::remove_source later.
Sourcefn remove_source(&self, id: ProviderId)
fn remove_source(&self, id: ProviderId)
Deregister a source added by Self::add_source. Removing an
unknown id is a no-op.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".