wireshift_core/ops/
nop.rs1use crate::error::Result;
3use crate::op::{CompletionPayload, Op, OpDescriptor};
4
5#[derive(Clone, Copy, Debug, Default)]
15pub struct Nop;
16
17impl Op for Nop {
18 type Output = ();
19
20 fn name(&self) -> &'static str {
21 "nop"
22 }
23
24 fn into_descriptor(self) -> Result<OpDescriptor> {
25 Ok(OpDescriptor::Nop)
26 }
27
28 fn map_completion(payload: CompletionPayload) -> Result<Self::Output> {
29 match payload {
30 CompletionPayload::Unit => Ok(()),
31 other => Err(crate::error::Error::completion(
32 format!("nop received unexpected completion payload: {other:?}"),
33 "ensure the backend routes nop completions as unit payloads",
34 )),
35 }
36 }
37}