pub struct CommandProcessor<A: Accelerator> { /* private fields */ }Expand description
One synchronization-free command engine for a backend instance.
The backend’s immutable device information is fetched once during construction and then used for decoding, validation, and discovery responses. This prevents limits from changing beneath live object state and removes a backend call from the discovery path.
Implementations§
Source§impl<A: Accelerator> CommandProcessor<A>
impl<A: Accelerator> CommandProcessor<A>
pub fn new( accelerator: A, config: &WireConfig, namespace: ObjectNamespace, policy: ResourcePolicy, ) -> Result<Self, CommandProcessorInitError>
pub const fn device_info(&self) -> DeviceInfo
pub const fn health(&self) -> DeviceHealth
pub const fn resource_policy(&self) -> ResourcePolicy
Sourcepub const fn retained_bytes(&self) -> RetainedBytes
pub const fn retained_bytes(&self) -> RetainedBytes
Provider-retained bulk bytes still live or quarantined in this backend instance.
pub const fn decoder(&self) -> &FrameDecoder
pub const fn accelerator(&self) -> &A
pub const fn state(&self) -> &AcceleratorState<A>
Sourcepub fn reset(
&mut self,
namespace: ObjectNamespace,
) -> Result<ResetReport, ResetError>
pub fn reset( &mut self, namespace: ObjectNamespace, ) -> Result<ResetReport, ResetError>
Perform one bounded, child-before-parent reset pass.
The transport must stop fetching command chains and stop publishing completions before
calling this method. A reusable result renews every object table with namespace; every
prior ID is then stale. A discard-required result is sticky and makes no backend calls on
later reset attempts. The caller must discard the complete processor/backend instance.
Sourcepub fn process(
&mut self,
regions: &[ChainRegion],
request: &dyn ByteSource,
response: &mut dyn ByteSink,
) -> Result<CommandOutcome, CommandProcessError>
pub fn process( &mut self, regions: &[ChainRegion], request: &dyn ByteSource, response: &mut dyn ByteSink, ) -> Result<CommandOutcome, CommandProcessError>
Process one complete flattened command chain.
A successful preflight guarantees response capacity for the command’s largest success
payload before semantic state or the backend is touched. Once recovery is required, later
valid frames receive DEVICE_LOST without reaching semantic dispatch.