Skip to main content

Canonicalizer

Trait Canonicalizer 

Source
pub trait Canonicalizer: Send + Sync {
    // Required methods
    fn lang(&self) -> &'static str;
    fn canonicalize(&self, raw: &str) -> CanonicalSymbol;

    // Provided methods
    fn canonicalize_structured(
        &self,
        module: &str,
        class: &str,
        method: &str,
        _sig: &str,
    ) -> CanonicalSymbol { ... }
    fn resolve_async_frame(&self, _raw: &str) -> Option<String> { ... }
}
Expand description

A per-language canonicalizer. Impls are in the submodules.

Required Methods§

Source

fn lang(&self) -> &'static str

Source

fn canonicalize(&self, raw: &str) -> CanonicalSymbol

Convert a raw (possibly mangled) symbol name into a canonical form.

Provided Methods§

Source

fn canonicalize_structured( &self, module: &str, class: &str, method: &str, _sig: &str, ) -> CanonicalSymbol

Convert a structured symbol emitted by the tool (e.g., dotnet-trace yields separate module/class/method/sig). Default: join with . and fall through to canonicalize. Adapters override when they can do something smarter than the default join.

Source

fn resolve_async_frame(&self, _raw: &str) -> Option<String>

Best-effort unwrap of async/state-machine frames back to the user-visible method name. Returns Some(user_method) only when the raw frame is recognized as a compiler-generated wrapper.

Implementors§