Skip to main content

DiffTarget

Trait DiffTarget 

Source
pub trait DiffTarget: Send + Sync {
    // Required methods
    fn side(&self) -> Side;
    fn raw<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        method: HttpMethod,
        path: &'life1 str,
        body: Option<&'life2 [u8]>,
        content_type: Option<&'life3 str>,
    ) -> Pin<Box<dyn Future<Output = Result<Observation, DiffError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
}
Expand description

A cluster the harness can fire operations at.

Why raw() and not a typed client(): the typed CRUD trait engenho_types::client::KubeClient is NOT object-safe — its methods are generic over R: KubeResource, so &dyn KubeClient does not compile (there are zero dyn KubeClient uses in the whole engenho tree). A trait-level client() -> &dyn KubeClient, as the design sketched, is therefore not expressible in Rust. The reuse of the client is instead STRUCTURAL: every real target is built over the same Connection that also powers raw(), and exposes a concrete ReqwestKubeClient via kube_client(). The differ’s workhorse is raw() because it captures the status code + full JSON body that the typed CRUD surface erases into Result<R, KubeError>.

Required Methods§

Source

fn side(&self) -> Side

Which side this target is.

Source

fn raw<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, method: HttpMethod, path: &'life1 str, body: Option<&'life2 [u8]>, content_type: Option<&'life3 str>, ) -> Pin<Box<dyn Future<Output = Result<Observation, DiffError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Issue method path (+ optional body) and return the typed observation. Reaches the discovery / status-code / error-body surfaces the typed CRUD trait cannot.

§Errors

DiffError::Transport if the request fails, or DiffError::Kube if the auth header can’t be built.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§