gmsol_decode/decoder/
mod.rs1use crate::{decode::visitor::Visitor, error::DecodeError};
2
3pub mod account_access;
5
6pub mod cpi_event_access;
8
9pub mod decoder_impl;
11
12pub use decoder_impl::*;
13
14pub trait Decoder {
16 fn decode_account<V>(&self, visitor: V) -> Result<V::Value, DecodeError>
18 where
19 V: Visitor;
20
21 fn decode_transaction<V>(&self, visitor: V) -> Result<V::Value, DecodeError>
23 where
24 V: Visitor;
25
26 fn decode_anchor_cpi_events<V>(&self, visitor: V) -> Result<V::Value, DecodeError>
28 where
29 V: Visitor;
30
31 fn decode_owned_data<V>(&self, visitor: V) -> Result<V::Value, DecodeError>
35 where
36 V: Visitor;
37
38 fn decode_bytes<V>(&self, visitor: V) -> Result<V::Value, DecodeError>
42 where
43 V: Visitor;
44}
45
46impl<D: Decoder> Decoder for &D {
47 fn decode_account<V>(&self, visitor: V) -> Result<V::Value, DecodeError>
48 where
49 V: Visitor,
50 {
51 (**self).decode_account(visitor)
52 }
53
54 fn decode_transaction<V>(&self, visitor: V) -> Result<V::Value, DecodeError>
55 where
56 V: Visitor,
57 {
58 (**self).decode_transaction(visitor)
59 }
60
61 fn decode_anchor_cpi_events<V>(&self, visitor: V) -> Result<V::Value, DecodeError>
62 where
63 V: Visitor,
64 {
65 (**self).decode_anchor_cpi_events(visitor)
66 }
67
68 fn decode_owned_data<V>(&self, visitor: V) -> Result<V::Value, DecodeError>
69 where
70 V: Visitor,
71 {
72 (**self).decode_owned_data(visitor)
73 }
74
75 fn decode_bytes<V>(&self, visitor: V) -> Result<V::Value, DecodeError>
76 where
77 V: Visitor,
78 {
79 (**self).decode_bytes(visitor)
80 }
81}