icu_provider_adapters::fork::predicates

Trait ForkByErrorPredicate

Source
pub trait ForkByErrorPredicate {
    const UNIT_ERROR: DataErrorKind = DataErrorKind::MarkerNotFound;

    // Required method
    fn test(
        &self,
        marker: DataMarkerInfo,
        req: Option<DataRequest<'_>>,
        err: DataError,
    ) -> bool;
}
Expand description

The predicate trait used by ForkByErrorProvider.

Provided Associated Constants§

Source

const UNIT_ERROR: DataErrorKind = DataErrorKind::MarkerNotFound

The error to return if there are zero providers.

Required Methods§

Source

fn test( &self, marker: DataMarkerInfo, req: Option<DataRequest<'_>>, err: DataError, ) -> bool

This function is called when a data request fails and there are additional providers that could possibly fulfill the request.

Arguments:

  • &self = Reference to the struct implementing the trait (for data capture)
  • marker = The [DataMarkerInfo] associated with the request
  • req = The [DataRequest]. This may be None if there is no request, such as inside [IterableDynamicDataProvider].
  • err = The error that occurred.

Return value:

  • true to discard the error and attempt the request with the next provider.
  • false to return the error and not perform any additional requests.

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.

Implementors§

Source§

impl ForkByErrorPredicate for IdentifierNotFoundPredicate

Source§

const UNIT_ERROR: DataErrorKind = DataErrorKind::IdentifierNotFound

Source§

impl ForkByErrorPredicate for MarkerNotFoundPredicate

Source§

const UNIT_ERROR: DataErrorKind = DataErrorKind::MarkerNotFound