[][src]Trait k8_client::metadata::MetadataClient

pub trait MetadataClient: Send + Sync {
    type MetadataClientError: MetadataClientError + From<Error> + From<DiffError> + From<Error> + Send + Display;
    fn retrieve_item<'life0, 'life1, 'async_trait, S, M>(
        &'life0 self,
        metadata: &'life1 M
    ) -> Pin<Box<dyn Future<Output = Result<K8Obj<S, <S as Spec>::Status>, Self::MetadataClientError>> + 'async_trait + Send>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        M: K8Meta<S> + Send + Sync + 'async_trait,
        S: Spec + 'async_trait,
        Self: 'async_trait,
        K8Obj<S, <S as Spec>::Status>: DeserializeOwned
;
fn retrieve_items<'life0, 'life1, 'async_trait, S>(
        &'life0 self,
        namespace: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<K8List<S, <S as Spec>::Status>, Self::MetadataClientError>> + 'async_trait + Send>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        S: Spec + 'async_trait,
        Self: 'async_trait,
        K8List<S, <S as Spec>::Status>: DeserializeOwned
;
fn delete_item<'life0, 'life1, 'async_trait, S, M>(
        &'life0 self,
        metadata: &'life1 M
    ) -> Pin<Box<dyn Future<Output = Result<K8Status, Self::MetadataClientError>> + 'async_trait + Send>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        M: K8Meta<S> + Send + Sync + 'async_trait,
        S: Spec + 'async_trait,
        Self: 'async_trait
;
fn create_item<'life0, 'async_trait, S>(
        &'life0 self,
        value: K8SpecObj<S, InputObjectMeta>
    ) -> Pin<Box<dyn Future<Output = Result<K8Obj<S, <S as Spec>::Status>, Self::MetadataClientError>> + 'async_trait + Send>>
    where
        'life0: 'async_trait,
        S: Spec + Send + 'async_trait,
        Self: 'async_trait,
        K8SpecObj<S, InputObjectMeta>: Serialize,
        K8SpecObj<S, InputObjectMeta>: Debug,
        K8Obj<S, <S as Spec>::Status>: DeserializeOwned
;
fn update_status<'life0, 'life1, 'async_trait, S>(
        &'life0 self,
        value: &'life1 UpdateK8ObjStatus<S, <S as Spec>::Status>
    ) -> Pin<Box<dyn Future<Output = Result<K8Obj<S, <S as Spec>::Status>, Self::MetadataClientError>> + 'async_trait + Send>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        S: Spec + Send + Sync + 'async_trait,
        Self: 'async_trait,
        UpdateK8ObjStatus<S, <S as Spec>::Status>: Serialize,
        UpdateK8ObjStatus<S, <S as Spec>::Status>: Debug,
        K8Obj<S, <S as Spec>::Status>: DeserializeOwned,
        <S as Spec>::Status: Send,
        <S as Spec>::Status: Sync
;
fn patch_spec<'life0, 'life1, 'life2, 'async_trait, S, M>(
        &'life0 self,
        metadata: &'life1 M,
        patch: &'life2 Value
    ) -> Pin<Box<dyn Future<Output = Result<K8Obj<S, <S as Spec>::Status>, Self::MetadataClientError>> + 'async_trait + Send>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        M: K8Meta<S> + Display + Send + Sync + 'async_trait,
        S: Spec + Debug + 'async_trait,
        Self: 'async_trait,
        K8Obj<S, <S as Spec>::Status>: DeserializeOwned
;
fn watch_stream_since<S>(
        &self,
        namespace: &str,
        resource_version: Option<String>
    ) -> Pin<Box<dyn Stream<Item = Result<Vec<Result<K8Watch<S, <S as Spec>::Status>, Self::MetadataClientError>>, Self::MetadataClientError>> + Send>>
    where
        S: Spec + Debug + Send + 'static,
        K8Watch<S, <S as Spec>::Status>: DeserializeOwned,
        <S as Spec>::Status: Debug,
        <S as Spec>::Status: Send
; fn apply<'life0, 'async_trait, S>(
        &'life0 self,
        value: K8SpecObj<S, InputObjectMeta>
    ) -> Pin<Box<dyn Future<Output = Result<ApplyResult<S, <S as Spec>::Status>, Self::MetadataClientError>> + 'async_trait + Send>>
    where
        'life0: 'async_trait,
        S: Spec + Serialize + Debug + Clone + Send + 'async_trait,
        Self: 'async_trait,
        K8SpecObj<S, InputObjectMeta>: Serialize,
        K8SpecObj<S, InputObjectMeta>: Debug,
        K8Obj<S, <S as Spec>::Status>: DeserializeOwned,
        K8Obj<S, <S as Spec>::Status>: Debug,
        <S as Spec>::Status: Send,
        Self::MetadataClientError: From<Error>,
        Self::MetadataClientError: From<DiffError>,
        Self::MetadataClientError: Send
, { ... }
fn watch_stream_now<S>(
        &self,
        ns: String
    ) -> Pin<Box<dyn Stream<Item = Result<Vec<Result<K8Watch<S, <S as Spec>::Status>, Self::MetadataClientError>>, Self::MetadataClientError>> + Send>>
    where
        S: Spec + Debug + 'static + Send,
        K8Watch<S, <S as Spec>::Status>: DeserializeOwned,
        K8List<S, <S as Spec>::Status>: DeserializeOwned,
        <S as Spec>::Status: Debug,
        <S as Spec>::Status: Send
, { ... }
fn exists<'life0, 'life1, 'async_trait, S, M>(
        &'life0 self,
        metadata: &'life1 M
    ) -> Pin<Box<dyn Future<Output = Result<bool, Self::MetadataClientError>> + 'async_trait + Send>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        M: K8Meta<S> + Display + Send + Sync + 'async_trait,
        S: Spec + Serialize + Debug + 'async_trait,
        Self: 'async_trait,
        K8Obj<S, <S as Spec>::Status>: DeserializeOwned,
        K8Obj<S, <S as Spec>::Status>: Serialize,
        K8Obj<S, <S as Spec>::Status>: Debug,
        K8Obj<S, <S as Spec>::Status>: Clone
, { ... } }

Associated Types

Loading content...

Required methods

fn retrieve_item<'life0, 'life1, 'async_trait, S, M>(
    &'life0 self,
    metadata: &'life1 M
) -> Pin<Box<dyn Future<Output = Result<K8Obj<S, <S as Spec>::Status>, Self::MetadataClientError>> + 'async_trait + Send>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    M: K8Meta<S> + Send + Sync + 'async_trait,
    S: Spec + 'async_trait,
    Self: 'async_trait,
    K8Obj<S, <S as Spec>::Status>: DeserializeOwned

retrieval a single item

fn retrieve_items<'life0, 'life1, 'async_trait, S>(
    &'life0 self,
    namespace: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<K8List<S, <S as Spec>::Status>, Self::MetadataClientError>> + 'async_trait + Send>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    S: Spec + 'async_trait,
    Self: 'async_trait,
    K8List<S, <S as Spec>::Status>: DeserializeOwned

fn delete_item<'life0, 'life1, 'async_trait, S, M>(
    &'life0 self,
    metadata: &'life1 M
) -> Pin<Box<dyn Future<Output = Result<K8Status, Self::MetadataClientError>> + 'async_trait + Send>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    M: K8Meta<S> + Send + Sync + 'async_trait,
    S: Spec + 'async_trait,
    Self: 'async_trait, 

fn create_item<'life0, 'async_trait, S>(
    &'life0 self,
    value: K8SpecObj<S, InputObjectMeta>
) -> Pin<Box<dyn Future<Output = Result<K8Obj<S, <S as Spec>::Status>, Self::MetadataClientError>> + 'async_trait + Send>> where
    'life0: 'async_trait,
    S: Spec + Send + 'async_trait,
    Self: 'async_trait,
    K8SpecObj<S, InputObjectMeta>: Serialize,
    K8SpecObj<S, InputObjectMeta>: Debug,
    K8Obj<S, <S as Spec>::Status>: DeserializeOwned

create new object

fn update_status<'life0, 'life1, 'async_trait, S>(
    &'life0 self,
    value: &'life1 UpdateK8ObjStatus<S, <S as Spec>::Status>
) -> Pin<Box<dyn Future<Output = Result<K8Obj<S, <S as Spec>::Status>, Self::MetadataClientError>> + 'async_trait + Send>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    S: Spec + Send + Sync + 'async_trait,
    Self: 'async_trait,
    UpdateK8ObjStatus<S, <S as Spec>::Status>: Serialize,
    UpdateK8ObjStatus<S, <S as Spec>::Status>: Debug,
    K8Obj<S, <S as Spec>::Status>: DeserializeOwned,
    <S as Spec>::Status: Send,
    <S as Spec>::Status: Sync

update status

fn patch_spec<'life0, 'life1, 'life2, 'async_trait, S, M>(
    &'life0 self,
    metadata: &'life1 M,
    patch: &'life2 Value
) -> Pin<Box<dyn Future<Output = Result<K8Obj<S, <S as Spec>::Status>, Self::MetadataClientError>> + 'async_trait + Send>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    M: K8Meta<S> + Display + Send + Sync + 'async_trait,
    S: Spec + Debug + 'async_trait,
    Self: 'async_trait,
    K8Obj<S, <S as Spec>::Status>: DeserializeOwned

patch existing with spec

fn watch_stream_since<S>(
    &self,
    namespace: &str,
    resource_version: Option<String>
) -> Pin<Box<dyn Stream<Item = Result<Vec<Result<K8Watch<S, <S as Spec>::Status>, Self::MetadataClientError>>, Self::MetadataClientError>> + Send>> where
    S: Spec + Debug + Send + 'static,
    K8Watch<S, <S as Spec>::Status>: DeserializeOwned,
    <S as Spec>::Status: Debug,
    <S as Spec>::Status: Send

stream items since resource versions

Loading content...

Provided methods

fn apply<'life0, 'async_trait, S>(
    &'life0 self,
    value: K8SpecObj<S, InputObjectMeta>
) -> Pin<Box<dyn Future<Output = Result<ApplyResult<S, <S as Spec>::Status>, Self::MetadataClientError>> + 'async_trait + Send>> where
    'life0: 'async_trait,
    S: Spec + Serialize + Debug + Clone + Send + 'async_trait,
    Self: 'async_trait,
    K8SpecObj<S, InputObjectMeta>: Serialize,
    K8SpecObj<S, InputObjectMeta>: Debug,
    K8Obj<S, <S as Spec>::Status>: DeserializeOwned,
    K8Obj<S, <S as Spec>::Status>: Debug,
    <S as Spec>::Status: Send,
    Self::MetadataClientError: From<Error>,
    Self::MetadataClientError: From<DiffError>,
    Self::MetadataClientError: Send

apply object, this is similar to kubectl apply for now, this doesn't do any optimization if object doesn't exist, it will be created if object exist, it will be patched by using strategic merge diff

fn watch_stream_now<S>(
    &self,
    ns: String
) -> Pin<Box<dyn Stream<Item = Result<Vec<Result<K8Watch<S, <S as Spec>::Status>, Self::MetadataClientError>>, Self::MetadataClientError>> + Send>> where
    S: Spec + Debug + 'static + Send,
    K8Watch<S, <S as Spec>::Status>: DeserializeOwned,
    K8List<S, <S as Spec>::Status>: DeserializeOwned,
    <S as Spec>::Status: Debug,
    <S as Spec>::Status: Send

fn exists<'life0, 'life1, 'async_trait, S, M>(
    &'life0 self,
    metadata: &'life1 M
) -> Pin<Box<dyn Future<Output = Result<bool, Self::MetadataClientError>> + 'async_trait + Send>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    M: K8Meta<S> + Display + Send + Sync + 'async_trait,
    S: Spec + Serialize + Debug + 'async_trait,
    Self: 'async_trait,
    K8Obj<S, <S as Spec>::Status>: DeserializeOwned,
    K8Obj<S, <S as Spec>::Status>: Serialize,
    K8Obj<S, <S as Spec>::Status>: Debug,
    K8Obj<S, <S as Spec>::Status>: Clone

Check if the object exists, return true or false.

Loading content...

Implementors

impl MetadataClient for DoNothingClient[src]

type MetadataClientError = DoNothingError

impl MetadataClient for K8Client[src]

type MetadataClientError = ClientError

fn retrieve_item<'life0, 'life1, 'async_trait, S, M>(
    &'life0 self,
    metadata: &'life1 M
) -> Pin<Box<dyn Future<Output = Result<K8Obj<S, S::Status>, ClientError>> + Send + 'async_trait>> where
    K8Obj<S, S::Status>: DeserializeOwned,
    S: Spec,
    M: K8Meta<S> + Send + Sync,
    S: 'async_trait,
    M: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

retrieval a single item

fn create_item<'life0, 'async_trait, S>(
    &'life0 self,
    value: InputK8Obj<S>
) -> Pin<Box<dyn Future<Output = Result<K8Obj<S, S::Status>, ClientError>> + Send + 'async_trait>> where
    InputK8Obj<S>: Serialize + Debug,
    K8Obj<S, S::Status>: DeserializeOwned,
    S: Spec + Send,
    S: 'async_trait,
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

create new object

fn update_status<'life0, 'life1, 'async_trait, S>(
    &'life0 self,
    value: &'life1 UpdateK8ObjStatus<S, S::Status>
) -> Pin<Box<dyn Future<Output = Result<K8Obj<S, S::Status>, ClientError>> + Send + 'async_trait>> where
    UpdateK8ObjStatus<S, S::Status>: Serialize + Debug,
    K8Obj<S, S::Status>: DeserializeOwned,
    S: Spec + Send + Sync,
    S::Status: Send + Sync,
    S: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

update status

fn patch_spec<'life0, 'life1, 'life2, 'async_trait, S, M>(
    &'life0 self,
    metadata: &'life1 M,
    patch: &'life2 Value
) -> Pin<Box<dyn Future<Output = Result<K8Obj<S, S::Status>, ClientError>> + Send + 'async_trait>> where
    K8Obj<S, S::Status>: DeserializeOwned,
    S: Spec + Debug,
    M: K8Meta<S> + Display + Send + Sync,
    S: 'async_trait,
    M: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    Self: 'async_trait, 
[src]

patch existing with spec

fn watch_stream_since<S>(
    &self,
    namespace: &str,
    resource_version: Option<String>
) -> BoxStream<TokenStreamResult<S, S::Status, Self::MetadataClientError>> where
    K8Watch<S, S::Status>: DeserializeOwned,
    S: Spec + Debug + 'static,
    S::Status: Debug
[src]

stream items since resource versions

Loading content...