Trait LabelledResolvable

Source
pub trait LabelledResolvable {
    type ResolverOutput;
}
Expand description

LabelledResolvable is a marker trait, serving a few purposes:

  • It avoids polluting every type with a resolve method
  • It avoids trait definition collisions, by ensuring key types (e.g. &str) don’t implement it.
  • It allows providing ResolverOutput to establish what kind of resolver it works with. This allows distinguishing “leaf” nodes which can be directly resolved from a resolver, and have ResolverOutput equal to Self, from container types (e.g. Option and Vec which don’t have that bound).

If implementing this with ResolverOutput = Self, you will likely want to use labelled_resolvable_with_identity_impl or [labelled_resolvable_with_try_into_impls] to implement this trait and a reflexive or blanket impl using try_into.

Required Associated Types§

Source

type ResolverOutput

You’ll be passed a resolver, what will the resolver output? Often this will be Self, but sometimes it will be another type which you will need to map into Self.

Implementors§