Struct tikv::storage::txn::commands::TypedCommand [−][src]
A Command with its return type, reified as the generic parameter T.
Incoming grpc requests (like CommitRequest, PrewriteRequest) are converted to
this type via a series of transformations. That process is described below using
CommitRequest as an example:
- A
CommitRequestis handled by thefuture_commitmethod in kv.rs, where it needs to be transformed to aTypedCommandbefore being passed to thestorage.sched_txn_commandmethod. - The
From<CommitRequest>impl forTypedCommandgets chosen, and its generic parameter indicates that the result type for this instance ofTypedCommandis going to beTxnStatus- one of the variants of theStorageCallbackenum. - In the above
frommethod, the details of the commit request are captured by creating an instance of the structstorage::txn::commands::commit::Commandvia itsnewmethod. - This struct is wrapped in a variant of the enum
storage::txn::commands::Command. This enum exists to facilitate generic operations over different commands. - Finally, the
Commandenum variant forCommitis converted to theTypedCommandusing theFrom<Command>impl forTypedCommand.
For other requests, see the corresponding future_ method, the From trait
implementation and so on.
Fields
cmd: Command_pd: PhantomData<T>Track the type of the command’s return value.
Trait Implementations
impl From<BatchRollbackRequest> for TypedCommand<()>[src]
fn from(req: BatchRollbackRequest) -> Self[src]
impl From<CheckSecondaryLocksRequest> for TypedCommand<SecondaryLocksStatus>[src]
fn from(req: CheckSecondaryLocksRequest) -> Self[src]
impl From<CheckTxnStatusRequest> for TypedCommand<TxnStatus>[src]
fn from(req: CheckTxnStatusRequest) -> Self[src]
impl From<CleanupRequest> for TypedCommand<()>[src]
fn from(req: CleanupRequest) -> Self[src]
impl<T: StorageCallbackType> From<Command> for TypedCommand<T>[src]
fn from(cmd: Command) -> TypedCommand<T>[src]
impl From<CommitRequest> for TypedCommand<TxnStatus>[src]
fn from(req: CommitRequest) -> Self[src]
impl From<MvccGetByKeyRequest> for TypedCommand<MvccInfo>[src]
fn from(req: MvccGetByKeyRequest) -> Self[src]
impl From<MvccGetByStartTsRequest> for TypedCommand<Option<(Key, MvccInfo)>>[src]
fn from(req: MvccGetByStartTsRequest) -> Self[src]
impl From<PessimisticLockRequest> for TypedCommand<StorageResult<PessimisticLockRes>>[src]
fn from(req: PessimisticLockRequest) -> Self[src]
impl From<PessimisticRollbackRequest> for TypedCommand<Vec<StorageResult<()>>>[src]
fn from(req: PessimisticRollbackRequest) -> Self[src]
impl From<PrewriteRequest> for TypedCommand<PrewriteResult>[src]
fn from(req: PrewriteRequest) -> Self[src]
impl From<ResolveLockRequest> for TypedCommand<()>[src]
fn from(req: ResolveLockRequest) -> Self[src]
impl From<TxnHeartBeatRequest> for TypedCommand<TxnStatus>[src]
fn from(req: TxnHeartBeatRequest) -> Self[src]
impl<T> From<TypedCommand<T>> for Command[src]
fn from(t: TypedCommand<T>) -> Command[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for TypedCommand<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for TypedCommand<T> where
T: Send,
T: Send,
impl<T> Sync for TypedCommand<T> where
T: Sync,
T: Sync,
impl<T> Unpin for TypedCommand<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for TypedCommand<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<V, W> ConvertFrom<W> for V where
W: ConvertTo<V>, [src]
W: ConvertTo<V>,
pub fn convert_from(ctx: &mut EvalContext, from: W) -> Result<V, Error>[src]
impl<T> From<T> for T[src]
impl<T> Instrument for T[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>[src]
pub fn in_current_span(self) -> Instrumented<Self>[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> Pointable for T[src]
pub const ALIGN: usize[src]
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize[src]
pub unsafe fn deref<'a>(ptr: usize) -> &'a T[src]
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T[src]
pub unsafe fn drop(ptr: usize)[src]
impl<T> Pointable for T[src]
pub const ALIGN: usize[src]
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize[src]
pub unsafe fn deref<'a>(ptr: usize) -> &'a T[src]
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T[src]
pub unsafe fn drop(ptr: usize)[src]
impl<T> Same<T> for T[src]
type Output = T
Should always be Self
impl<T> Sealed<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> SendSyncUnwindSafe for T where
T: Send + Sync + UnwindSafe + ?Sized, [src]
T: Send + Sync + UnwindSafe + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>, [src]
V: MultiLane<T>,