Struct mz_service::client::Partitioned

source ·
pub struct Partitioned<P, C, R>
where (C, R): Partitionable<C, R>,
{ pub parts: Vec<P>, state: <(C, R) as Partitionable<C, R>>::PartitionedState, }
Expand description

A client whose implementation is partitioned across a number of other clients.

Such a client needs to broadcast (partitioned) commands to all of its clients, and await responses from each of the client partitions before it can respond.

Fields§

§parts: Vec<P>

The individual partitions representing per-worker clients.

§state: <(C, R) as Partitionable<C, R>>::PartitionedState

The partitioned state.

Implementations§

source§

impl<P, C, R> Partitioned<P, C, R>
where (C, R): Partitionable<C, R>,

source

pub fn new(parts: Vec<P>) -> Self

Create a client partitioned across multiple client shards.

Trait Implementations§

source§

impl<P: Debug, C: Debug, R: Debug> Debug for Partitioned<P, C, R>
where (C, R): Partitionable<C, R>,

source§

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

Formats the value using the given formatter. Read more
source§

impl<P, C, R> GenericClient<C, R> for Partitioned<P, C, R>
where P: GenericClient<C, R>, (C, R): Partitionable<C, R>, C: Debug + Send, R: Debug + Send,

source§

fn recv<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Option<R>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

§Cancel safety

This method is cancel safe. If recv is used as the event in a tokio::select! statement and some other branch completes first, it is guaranteed that no messages were received by this client.

source§

fn send<'life0, 'async_trait>( &'life0 mut self, cmd: C, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Sends a command to the dataflow server. Read more
source§

fn as_stream<'a>( &'a mut self, ) -> Pin<Box<dyn Stream<Item = Result<R, Error>> + Send + 'a>>
where R: Send + 'a,

Returns an adapter that treats the client as a stream. Read more

Auto Trait Implementations§

§

impl<P, C, R> !Freeze for Partitioned<P, C, R>

§

impl<P, C, R> !RefUnwindSafe for Partitioned<P, C, R>

§

impl<P, C, R> Send for Partitioned<P, C, R>
where P: Send,

§

impl<P, C, R> !Sync for Partitioned<P, C, R>

§

impl<P, C, R> !Unpin for Partitioned<P, C, R>

§

impl<P, C, R> !UnwindSafe for Partitioned<P, C, R>

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