Skip to main content

HttpDriver

Trait HttpDriver 

Source
pub trait HttpDriver: Send + Sync {
    type Session: Send + Sync;

    // Required methods
    fn connector_name(&self) -> &'static str;
    fn batching(&self) -> HttpBatching;
    fn session<'life0, 'life1, 'async_trait>(
        &'life0 self,
        calls: &'life1 CallSlot,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Session, FaucetError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn send<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        calls: &'life1 CallSlot,
        session: &'life2 Self::Session,
        body: &'life3 Value,
    ) -> Pin<Box<dyn Future<Output = Result<(), FaucetError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;

    // Provided methods
    fn config_schema(&self) -> Value { ... }
    fn dataset_uri(&self) -> String { ... }
    fn call_context(&self) -> CallContext { ... }
    fn check<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        calls: &'life1 CallSlot,
        ctx: &'life2 CheckContext,
    ) -> Pin<Box<dyn Future<Output = Result<CheckReport, FaucetError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
    fn batch_atomicity(&self) -> BatchAtomicity { ... }
}
Expand description

An HTTP destination’s primitives (RFC 0014). Wrap it in an HttpSinkDriver, then a DriverSink.

Required Associated Types§

Source

type Session: Send + Sync

What one page’s requests share — resolved credentials, typically.

Required Methods§

Source

fn connector_name(&self) -> &'static str

The connector’s name.

Source

fn batching(&self) -> HttpBatching

How pages become requests.

Source

fn session<'life0, 'life1, 'async_trait>( &'life0 self, calls: &'life1 CallSlot, ) -> Pin<Box<dyn Future<Output = Result<Self::Session, FaucetError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Prepare what one page’s requests share.

Source

fn send<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, calls: &'life1 CallSlot, session: &'life2 Self::Session, body: &'life3 Value, ) -> Pin<Box<dyn Future<Output = Result<(), FaucetError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Send one body. Ok once the endpoint accepted it.

Provided Methods§

Source

fn config_schema(&self) -> Value

The JSON Schema of the connector’s config.

Source

fn dataset_uri(&self) -> String

The endpoint, for lineage (credential-free).

Source

fn call_context(&self) -> CallContext

The connector’s own call defaults (its retry policy).

Source

fn check<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, calls: &'life1 CallSlot, ctx: &'life2 CheckContext, ) -> Pin<Box<dyn Future<Output = Result<CheckReport, FaucetError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

A non-mutating preflight probe.

Source

fn batch_atomicity(&self) -> BatchAtomicity

What a failed write leaves behind.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§