Skip to main content

FoldProvider

Trait FoldProvider 

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

Source

fn id(&self) -> ProviderId

Source

fn kind(&self) -> ProviderKind

Source

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

Implementors§