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

pub trait MetadataClient: Send + Sync {
    type MetadataClientError: MetadataClientError + From<Error> + From<DiffError> + From<Error> + Send + Display;
#[must_use]    fn retrieve_item<'life0, 'life1, 'async_trait, S, M>(
        &'life0 self,
        metadata: &'life1 M
    ) -> Pin<Box<dyn Future<Output = Result<K8Obj<S>, Self::MetadataClientError>> + 'async_trait + Send>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        M: K8Meta + Send + Sync + 'async_trait,
        S: Spec + 'async_trait,
        Self: 'async_trait
;
#[must_use] fn retrieve_items_with_option<'life0, 'async_trait, S, N>(
        &'life0 self,
        namespace: N,
        option: Option<ListArg>
    ) -> Pin<Box<dyn Future<Output = Result<K8List<S>, Self::MetadataClientError>> + 'async_trait + Send>>
    where
        'life0: 'async_trait,
        N: Into<NameSpace> + Send + Sync + 'async_trait,
        S: Spec + 'async_trait,
        Self: 'async_trait
;
fn retrieve_items_in_chunks<'a, S, N>(
        self: Arc<Self>,
        namespace: N,
        limit: u32,
        option: Option<ListArg>
    ) -> Pin<Box<dyn Stream<Item = K8List<S>> + 'a + Send>>
    where
        N: Into<NameSpace> + Send + Sync + 'static,
        S: Spec + 'static
;
#[must_use] 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 + Send + Sync + 'async_trait,
        S: Spec + 'async_trait,
        Self: 'async_trait
;
#[must_use] fn create_item<'life0, 'async_trait, S>(
        &'life0 self,
        value: K8SpecObj<S, InputObjectMeta>
    ) -> Pin<Box<dyn Future<Output = Result<K8Obj<S>, Self::MetadataClientError>> + 'async_trait + Send>>
    where
        'life0: 'async_trait,
        S: Spec + 'async_trait,
        Self: 'async_trait
;
#[must_use] fn update_status<'life0, 'life1, 'async_trait, S>(
        &'life0 self,
        value: &'life1 UpdateK8ObjStatus<S>
    ) -> Pin<Box<dyn Future<Output = Result<K8Obj<S>, Self::MetadataClientError>> + 'async_trait + Send>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        S: Spec + 'async_trait,
        Self: 'async_trait
;
#[must_use] 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>, Self::MetadataClientError>> + 'async_trait + Send>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        M: K8Meta + Display + Send + Sync + 'async_trait,
        S: Spec + 'async_trait,
        Self: 'async_trait
;
fn watch_stream_since<S, N>(
        &self,
        namespace: N,
        resource_version: Option<String>
    ) -> Pin<Box<dyn Stream<Item = Result<Vec<Result<K8Watch<S>, Self::MetadataClientError>>, Self::MetadataClientError>> + Send>>
    where
        N: Into<NameSpace>,
        S: Spec + 'static
; #[must_use] fn retrieve_items<'life0, 'async_trait, S, N>(
        &'life0 self,
        namespace: N
    ) -> Pin<Box<dyn Future<Output = Result<K8List<S>, Self::MetadataClientError>> + 'async_trait + Send>>
    where
        'life0: 'async_trait,
        N: Into<NameSpace> + Send + Sync + 'async_trait,
        S: Spec + 'async_trait,
        Self: 'async_trait
, { ... }
#[must_use] fn apply<'life0, 'async_trait, S>(
        &'life0 self,
        value: K8SpecObj<S, InputObjectMeta>
    ) -> Pin<Box<dyn Future<Output = Result<ApplyResult<S>, Self::MetadataClientError>> + 'async_trait + Send>>
    where
        'life0: 'async_trait,
        S: Spec + 'async_trait,
        Self: 'async_trait,
        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>, Self::MetadataClientError>>, Self::MetadataClientError>> + Send>>
    where
        S: Spec + 'static
, { ... }
#[must_use] 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 + Display + Send + Sync + 'async_trait,
        S: Spec + 'async_trait,
        Self: 'async_trait
, { ... } }

Associated Types

Loading content...

Required methods

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

retrieval a single item

#[must_use]fn retrieve_items_with_option<'life0, 'async_trait, S, N>(
    &'life0 self,
    namespace: N,
    option: Option<ListArg>
) -> Pin<Box<dyn Future<Output = Result<K8List<S>, Self::MetadataClientError>> + 'async_trait + Send>> where
    'life0: 'async_trait,
    N: Into<NameSpace> + Send + Sync + 'async_trait,
    S: Spec + 'async_trait,
    Self: 'async_trait, 

fn retrieve_items_in_chunks<'a, S, N>(
    self: Arc<Self>,
    namespace: N,
    limit: u32,
    option: Option<ListArg>
) -> Pin<Box<dyn Stream<Item = K8List<S>> + 'a + Send>> where
    N: Into<NameSpace> + Send + Sync + 'static,
    S: Spec + 'static, 

returns stream of items in chunks

#[must_use]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 + Send + Sync + 'async_trait,
    S: Spec + 'async_trait,
    Self: 'async_trait, 

#[must_use]fn create_item<'life0, 'async_trait, S>(
    &'life0 self,
    value: K8SpecObj<S, InputObjectMeta>
) -> Pin<Box<dyn Future<Output = Result<K8Obj<S>, Self::MetadataClientError>> + 'async_trait + Send>> where
    'life0: 'async_trait,
    S: Spec + 'async_trait,
    Self: 'async_trait, 

create new object

#[must_use]fn update_status<'life0, 'life1, 'async_trait, S>(
    &'life0 self,
    value: &'life1 UpdateK8ObjStatus<S>
) -> Pin<Box<dyn Future<Output = Result<K8Obj<S>, Self::MetadataClientError>> + 'async_trait + Send>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    S: Spec + 'async_trait,
    Self: 'async_trait, 

update status

#[must_use]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>, Self::MetadataClientError>> + 'async_trait + Send>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    M: K8Meta + Display + Send + Sync + 'async_trait,
    S: Spec + 'async_trait,
    Self: 'async_trait, 

patch existing with spec

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

stream items since resource versions

Loading content...

Provided methods

#[must_use]fn retrieve_items<'life0, 'async_trait, S, N>(
    &'life0 self,
    namespace: N
) -> Pin<Box<dyn Future<Output = Result<K8List<S>, Self::MetadataClientError>> + 'async_trait + Send>> where
    'life0: 'async_trait,
    N: Into<NameSpace> + Send + Sync + 'async_trait,
    S: Spec + 'async_trait,
    Self: 'async_trait, 

retrieve all items a single chunk this may cause client to hang if there are too many items

#[must_use]fn apply<'life0, 'async_trait, S>(
    &'life0 self,
    value: K8SpecObj<S, InputObjectMeta>
) -> Pin<Box<dyn Future<Output = Result<ApplyResult<S>, Self::MetadataClientError>> + 'async_trait + Send>> where
    'life0: 'async_trait,
    S: Spec + 'async_trait,
    Self: 'async_trait,
    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>, Self::MetadataClientError>>, Self::MetadataClientError>> + Send>> where
    S: Spec + 'static, 

#[must_use]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 + Display + Send + Sync + 'async_trait,
    S: Spec + 'async_trait,
    Self: 'async_trait, 

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>, ClientError>> + Send + 'async_trait>> where
    S: Spec,
    M: K8Meta + 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>, ClientError>> + Send + 'async_trait>> where
    S: Spec,
    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>
) -> Pin<Box<dyn Future<Output = Result<K8Obj<S>, ClientError>> + Send + 'async_trait>> where
    S: Spec,
    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>, ClientError>> + Send + 'async_trait>> where
    S: Spec,
    M: K8Meta + 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, N>(
    &self,
    namespace: N,
    resource_version: Option<String>
) -> BoxStream<'_, TokenStreamResult<S, Self::MetadataClientError>> where
    S: Spec + 'static,
    S::Status: 'static,
    S::Header: 'static,
    N: Into<NameSpace>, 
[src]

stream items since resource versions

Loading content...