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
CommitRequest
is handled by thefuture_commit
method in kv.rs, where it needs to be transformed to aTypedCommand
before being passed to thestorage.sched_txn_command
method. - The
From<CommitRequest>
impl forTypedCommand
gets chosen, and its generic parameter indicates that the result type for this instance ofTypedCommand
is going to beTxnStatus
- one of the variants of theStorageCallback
enum. - In the above
from
method, the details of the commit request are captured by creating an instance of the structstorage::txn::commands::commit::Command
via itsnew
method. - 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
Command
enum variant forCommit
is converted to theTypedCommand
using 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][+]
impl From<CheckSecondaryLocksRequest> for TypedCommand<SecondaryLocksStatus>
[src][+]
impl From<CheckTxnStatusRequest> for TypedCommand<TxnStatus>
[src][+]
impl From<CleanupRequest> for TypedCommand<()>
[src][+]
impl<T: StorageCallbackType> From<Command> for TypedCommand<T>
[src][+]
impl From<CommitRequest> for TypedCommand<TxnStatus>
[src][+]
impl From<MvccGetByKeyRequest> for TypedCommand<MvccInfo>
[src][+]
impl From<MvccGetByStartTsRequest> for TypedCommand<Option<(Key, MvccInfo)>>
[src][+]
impl From<PessimisticLockRequest> for TypedCommand<StorageResult<PessimisticLockRes>>
[src][+]
impl From<PessimisticRollbackRequest> for TypedCommand<Vec<StorageResult<()>>>
[src][+]
impl From<PrewriteRequest> for TypedCommand<PrewriteResult>
[src][+]
impl From<ResolveLockRequest> for TypedCommand<()>
[src][+]
impl From<TxnHeartBeatRequest> for TypedCommand<TxnStatus>
[src][+]
impl<T> From<TypedCommand<T>> for 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,
impl<V, W> ConvertFrom<W> for V where
W: ConvertTo<V>,
[src][+]
W: ConvertTo<V>,
impl<T> From<T> for T
[src][+]
impl<T> Instrument for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T> Pointable for T
[src][+]
impl<T> Pointable for T
[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>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src][+]
V: MultiLane<T>,