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