Skip to main content

ClientKernel

Struct ClientKernel 

Source
pub struct ClientKernel<T> { /* private fields */ }
Expand description

Reusable provider-neutral client policy kernel.

The kernel owns only its transport. It owns no executor, queue, clock, retry policy, or request storage. Every in-flight request must consume a caller-owned ClientWorkspaceLease.

Implementations§

Source§

impl<T> ClientKernel<T>

Source

pub fn execute_blocking<O, const N: usize>( &self, operation: &O, lease: ClientWorkspaceLease<'_, '_, N>, ) -> Result<O::Output, ClientExecutionError<O::Error, T::Error, O::DecodeError>>
where O: ClientOperation,

Prepares, authenticates, sends once, and checked-decodes synchronously.

Source

pub fn execute_blocking_observed<O, V, const N: usize>( &self, operation: &O, lease: ClientWorkspaceLease<'_, '_, N>, observer: &V, ) -> Result<O::Output, ClientExecutionError<O::Error, T::Error, O::DecodeError>>

Executes synchronously while emitting opt-in payload-free lifecycle events.

Source§

impl<T> ClientKernel<T>

Source

pub fn execute_async<O, const N: usize>( &self, operation: &O, lease: ClientWorkspaceLease<'_, '_, N>, ) -> impl Future<Output = Result<O::Output, ClientExecutionError<O::Error, T::Error, O::DecodeError>>> + Send

Prepares, authenticates, sends once, and checked-decodes with a Send transport.

Source

pub fn execute_async_observed<O, V, const N: usize>( &self, operation: &O, lease: ClientWorkspaceLease<'_, '_, N>, observer: &V, ) -> impl Future<Output = Result<O::Output, ClientExecutionError<O::Error, T::Error, O::DecodeError>>> + Send

Executes with a Send transport and opt-in payload-free lifecycle events.

Source§

impl<T> ClientKernel<T>

Source

pub async fn execute_local_async<O, const N: usize>( &self, operation: &O, lease: ClientWorkspaceLease<'_, '_, N>, ) -> Result<O::Output, ClientExecutionError<O::Error, T::Error, O::DecodeError>>
where O: ClientOperation,

Prepares, authenticates, sends once, and checked-decodes locally.

Source

pub async fn execute_local_async_observed<O, V, const N: usize>( &self, operation: &O, lease: ClientWorkspaceLease<'_, '_, N>, observer: &V, ) -> Result<O::Output, ClientExecutionError<O::Error, T::Error, O::DecodeError>>

Executes locally while emitting opt-in payload-free lifecycle events.

Source§

impl<T> ClientKernel<T>

Source

pub fn execute_blocking_with<'operation, O, R, P, D, F, G, const N: usize>( &self, operation: &'operation O, lease: ClientWorkspaceLease<'_, '_, N>, prepare: F, decode: G, ) -> Result<R, ClientExecutionError<P, T::Error, D>>
where F: for<'guard> FnOnce(&'operation O, &'guard mut PreparationStorageGuard<'_>) -> Result<PreparedRequest<'guard>, P>, G: FnOnce(&'operation O, ClientResponse<'_, '_>) -> Result<R, D>,

Executes through cleanup-owning provider preparation and decoding hooks.

Source§

impl<T> ClientKernel<T>

Source

pub fn execute_async_with<'operation, O, R, P, D, F, G, const N: usize>( &self, operation: &'operation O, lease: ClientWorkspaceLease<'_, '_, N>, prepare: F, decode: G, ) -> impl Future<Output = Result<R, ClientExecutionError<P, T::Error, D>>> + Send
where O: Sync, P: Send, R: Send, D: Send, F: for<'guard> FnOnce(&'operation O, &'guard mut PreparationStorageGuard<'_>) -> Result<PreparedRequest<'guard>, P> + Send, G: FnOnce(&'operation O, ClientResponse<'_, '_>) -> Result<R, D> + Send, T::Error: Send,

Send-async equivalent of Self::execute_blocking_with.

Source§

impl<T> ClientKernel<T>

Source

pub async fn execute_local_async_with<'operation, O, R, P, D, F, G, const N: usize>( &self, operation: &'operation O, lease: ClientWorkspaceLease<'_, '_, N>, prepare: F, decode: G, ) -> Result<R, ClientExecutionError<P, T::Error, D>>
where F: for<'guard> FnOnce(&'operation O, &'guard mut PreparationStorageGuard<'_>) -> Result<PreparedRequest<'guard>, P>, G: FnOnce(&'operation O, ClientResponse<'_, '_>) -> Result<R, D>,

Local-async equivalent of Self::execute_blocking_with.

Source§

impl<T> ClientKernel<T>

Source

pub const fn new(transport: T) -> Self

Creates a kernel around one endpoint-bound authenticated transport.

Source

pub const fn transport(&self) -> &T

Returns the underlying transport.

Source

pub fn into_transport(self) -> T

Consumes the kernel and returns its transport.

Trait Implementations§

Source§

impl<T> Debug for ClientKernel<T>

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> Freeze for ClientKernel<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for ClientKernel<T>
where T: RefUnwindSafe,

§

impl<T> Send for ClientKernel<T>
where T: Send,

§

impl<T> Sync for ClientKernel<T>
where T: Sync,

§

impl<T> Unpin for ClientKernel<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for ClientKernel<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for ClientKernel<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.