pub struct Dispatch<Req: KvRequest> {
pub request: Req,
pub kv_client: Option<Arc<dyn KvClient + Send + Sync>>,
}Expand description
The simplest plan which just dispatches a request to a specific kv server.
Fields§
§request: Req§kv_client: Option<Arc<dyn KvClient + Send + Sync>>Trait Implementations§
Source§impl<Req: KvRequest> Plan for Dispatch<Req>
impl<Req: KvRequest> Plan for Dispatch<Req>
Source§impl<Req: KvRequest + Shardable> Shardable for Dispatch<Req>
impl<Req: KvRequest + Shardable> Shardable for Dispatch<Req>
type Shard = <Req as Shardable>::Shard
fn shards( &self, pd_client: &Arc<impl PdClient>, ) -> BoxStream<'static, Result<(Self::Shard, RegionWithLeader)>>
fn apply_shard(&mut self, shard: Self::Shard)
Source§fn clone_then_apply_shard(&self, shard: Self::Shard) -> Self
fn clone_then_apply_shard(&self, shard: Self::Shard) -> Self
Implementation can skip unnecessary fields clone if fields will be overwritten by
apply_shard.fn apply_store(&mut self, store: &RegionStore) -> Result<()>
Source§impl<Req: KvRequest + StoreRequest> StoreRequest for Dispatch<Req>
impl<Req: KvRequest + StoreRequest> StoreRequest for Dispatch<Req>
Source§fn apply_store(&mut self, store: &Store)
fn apply_store(&mut self, store: &Store)
Apply the request to specified TiKV store.
Auto Trait Implementations§
impl<Req> Freeze for Dispatch<Req>where
Req: Freeze,
impl<Req> !RefUnwindSafe for Dispatch<Req>
impl<Req> Send for Dispatch<Req>
impl<Req> Sync for Dispatch<Req>
impl<Req> Unpin for Dispatch<Req>where
Req: Unpin,
impl<Req> !UnwindSafe for Dispatch<Req>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request