Skip to main content

JudgmentProvider

Trait JudgmentProvider 

Source
pub trait JudgmentProvider:
    Send
    + Sync
    + 'static {
    type Error: Error + Send + Sync + 'static;

    // Required method
    fn judge<'life0, 'async_trait>(
        &'life0 self,
        request: JudgmentRequest,
    ) -> Pin<Box<dyn Future<Output = Result<JudgmentResponse, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

The seam between a decision site and any concrete judgment backend.

One implementation per backend. A decision site holds a DynJudgment and never names the backend.

Required Associated Types§

Source

type Error: Error + Send + Sync + 'static

The backend’s concrete error type.

Required Methods§

Source

fn judge<'life0, 'async_trait>( &'life0 self, request: JudgmentRequest, ) -> Pin<Box<dyn Future<Output = Result<JudgmentResponse, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Answers every question in request over its state.

§Errors

Returns the backend’s error when the request is rejected, the credential is refused, the transport fails, or the response does not decode.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§