Skip to main content

Adapters

Trait Adapters 

Source
pub trait Adapters:
    Send
    + Sync
    + Debug {
    // Required methods
    fn http_backend(
        &self,
        endpoint: &str,
        timeout: Duration,
    ) -> Result<Arc<dyn HttpBackend>, Error>;
    fn build_services(
        &self,
        region: Region,
    ) -> Pin<Box<dyn Future<Output = Result<Arc<dyn BuildServices>, Error>> + Send + '_>>;
    fn clock(&self) -> Arc<dyn Clock> ⓘ;
    fn warn(&self, warning: &str);
}
Expand description

The production pieces a use case builds once it knows what they’re for.

Required Methods§

Source

fn http_backend( &self, endpoint: &str, timeout: Duration, ) -> Result<Arc<dyn HttpBackend>, Error>

The HTTP backend a session against endpoint sends through, whose non-streaming requests time out after timeout.

Source

fn build_services( &self, region: Region, ) -> Pin<Box<dyn Future<Output = Result<Arc<dyn BuildServices>, Error>> + Send + '_>>

The STS and S3 calls ensure_image makes, with credentials for region.

Source

fn clock(&self) -> Arc<dyn Clock> ⓘ

The clock a session reads when its builder was given none.

A session a sandbox builds takes the plane’s clock instead, so the lifecycle and the session it hands out read one time source.

Source

fn warn(&self, warning: &str)

Reports a warning no caller is left to receive, such as a Sandbox dropped with its VM still billing.

A use case can’t write to a stream itself, since the driving adapter owns those. It mustn’t panic or block: Drop calls it, and a panic there during an unwind aborts.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§