pub trait Resolve<X: Resolvable> {
// Required method
fn resolve(self) -> X;
}Expand description
This trait is intended to be used as an impl argument in helper methods, to accept
a wider range of arguments.
It should only be used where it is safe to panic if the wrong argument is provided, and where performance isn’t a primary concern.
It’s not expected for other types to implement this trait directly - instead they
should implement TryFrom to convert between the types.
If resolution needs to be keyed against an external resolver (e.g. a look-up to translate
string names into values), then LabelledResolve should be used instead.
§Implementers
- You should prefer to implement
ResolveFromas it is easier to implement due to trait coherence rules. Sometimes you can only implementResolvehowever. - If requiring a labelled resolution in your bounds, prefer
Resolvebecause slightly more types can implement it.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".