rig_core/operation/
verify.rs1use super::Whole;
12use crate::error::ProviderError;
13use crate::wire::{Call, Decoder, Flow, Free, Operation, Out, WireEvent, WireFrame};
14
15#[derive(Debug, Clone, Copy, PartialEq, Eq)]
18pub struct Verify;
19
20impl Operation for Verify {
21 type Request = ();
22 type Event = std::convert::Infallible;
23 type End = ();
24 type Response = ();
25 type Fold = Whole<Self>;
26 type Emit = Free;
27
28 fn fold(_request: &Self::Request, _call: &mut Call<'_>) -> Self::Fold {
29 Whole::new()
30 }
31}
32
33#[derive(Debug, Default)]
36pub struct VerifyDecoder;
37
38impl<'id> Decoder<'id, Verify> for VerifyDecoder {
39 type Event = ();
40
41 fn classify(&self, _frame: WireFrame) -> WireEvent<Self::Event> {
42 WireEvent::Known(())
43 }
44
45 fn decode(&mut self, _event: (), out: Out<'id, Verify>) -> Result<Flow, ProviderError> {
46 Ok(out.end(()))
47 }
48
49 fn eof(&mut self, out: Out<'id, Verify>) -> Result<Flow, ProviderError> {
52 Ok(out.end(()))
53 }
54}