pub trait Resolve<ResolvedT, AnnotatedT>: Sized {
// Required method
fn resolve_with_errors<ErrorRecipientT>(
self,
errors: &mut ErrorRecipientT,
) -> ResolveResult<ResolvedT, AnnotatedT>
where ErrorRecipientT: ErrorRecipient<ResolveError<AnnotatedT>>;
// Provided method
fn resolve(self) -> Result<ResolvedT, ResolveError<AnnotatedT>> { ... }
}Expand description
Resolve one type into another.
Required Methods§
Sourcefn resolve_with_errors<ErrorRecipientT>(
self,
errors: &mut ErrorRecipientT,
) -> ResolveResult<ResolvedT, AnnotatedT>where
ErrorRecipientT: ErrorRecipient<ResolveError<AnnotatedT>>,
fn resolve_with_errors<ErrorRecipientT>(
self,
errors: &mut ErrorRecipientT,
) -> ResolveResult<ResolvedT, AnnotatedT>where
ErrorRecipientT: ErrorRecipient<ResolveError<AnnotatedT>>,
Resolve one type into another.
Errors can be reported as usual by Err but also by the ErrorRecipient. 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.
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.