pub trait Resolve<ResolvedT, AnnotatedT>: Sized {
// Required method
fn resolve_with_errors<ErrorReceiverT>(
self,
errors: &mut ErrorReceiverT,
) -> ResolveResult<ResolvedT, AnnotatedT>
where ErrorReceiverT: ErrorReceiver<ResolveError<AnnotatedT>>;
// Provided method
fn resolve(self) -> Result<ResolvedT, ResolveError<AnnotatedT>> { ... }
}Expand description
Resolve one type into another.
Required Methods§
Sourcefn resolve_with_errors<ErrorReceiverT>(
self,
errors: &mut ErrorReceiverT,
) -> ResolveResult<ResolvedT, AnnotatedT>where
ErrorReceiverT: ErrorReceiver<ResolveError<AnnotatedT>>,
fn resolve_with_errors<ErrorReceiverT>(
self,
errors: &mut ErrorReceiverT,
) -> ResolveResult<ResolvedT, AnnotatedT>where
ErrorReceiverT: ErrorReceiver<ResolveError<AnnotatedT>>,
Resolve one type into another.
A lot like TryFrom, except that we can accumulate potentially annotated errors.
Errors can be reported as usual by Err but also by the ErrorReceiver. Callers should
thus check that errors is empty even when the function returns Ok.
The function may return Some partially resolved result even if there are errors.
Provided Methods§
Sourcefn resolve(self) -> Result<ResolvedT, ResolveError<AnnotatedT>>
fn resolve(self) -> Result<ResolvedT, ResolveError<AnnotatedT>>
Resolve one type into another.
A lot like TryFrom, except that we can accumulate potentially annotated errors.
Unlike resolve will fail on the first encountered error and will return ResolveError::Missing instead of None.
If you want all the errors use resolve instead.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.