pub trait FoldProvider: Send + Sync {
// Required methods
fn id(&self) -> ProviderId;
fn kind(&self) -> ProviderKind;
fn compute(&self, ctx: &FoldContext<'_>) -> Vec<Fold>;
}Expand description
D.3.f.0: a registered source of folds.
id() is stable across recomputes and namespaces the
provider’s identity hashes (so two providers that emit
folds with the same (start_line, end_line) don’t
collide on Fold::identity).
Required Methods§
fn id(&self) -> ProviderId
fn kind(&self) -> ProviderKind
fn compute(&self, ctx: &FoldContext<'_>) -> Vec<Fold>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".