multiversx_sc/types/interaction/tx_result_handler_list/
original_result.rs

1use core::marker::PhantomData;
2
3use crate::types::{TxEmptyResultHandler, TxEnv, TxResultHandler};
4
5/// Contains no data.
6///
7/// Indicates to the compiler the original result type expected from a transaction.
8///
9/// Note that the transaction result might be interpreted as a different type,
10/// but the originally declared type is required to perform any type checking.
11pub struct OriginalResultMarker<O> {
12    _phantom: PhantomData<O>,
13}
14
15impl<O> Default for OriginalResultMarker<O> {
16    fn default() -> Self {
17        Self {
18            _phantom: Default::default(),
19        }
20    }
21}
22
23impl<O> OriginalResultMarker<O> {
24    pub fn new() -> Self {
25        Self::default()
26    }
27}
28
29impl<Env, O> TxResultHandler<Env> for OriginalResultMarker<O>
30where
31    Env: TxEnv,
32{
33    type OriginalResult = O;
34}
35
36impl<Env, O> TxEmptyResultHandler<Env> for OriginalResultMarker<O> where Env: TxEnv {}