penumbra_sdk_ibc/component/
ibc_action_with_handler.rs

1use crate::component::app_handler::AppHandler;
2use crate::IbcRelay;
3use std::marker::PhantomData;
4
5use super::HostInterface;
6
7pub struct IbcRelayWithHandlers<AH, HI>(IbcRelay, PhantomData<AH>, PhantomData<HI>);
8
9impl<AH, HI> IbcRelayWithHandlers<AH, HI> {
10    pub fn new(action: IbcRelay) -> Self {
11        Self(action, PhantomData, PhantomData)
12    }
13
14    pub fn action(&self) -> &IbcRelay {
15        &self.0
16    }
17
18    pub fn into_inner(self) -> IbcRelay {
19        self.0
20    }
21}
22
23impl<AH, HI> From<IbcRelayWithHandlers<AH, HI>> for IbcRelay {
24    fn from(value: IbcRelayWithHandlers<AH, HI>) -> Self {
25        value.0
26    }
27}
28
29impl IbcRelay {
30    pub fn with_handler<AH: AppHandler, HI: HostInterface>(self) -> IbcRelayWithHandlers<AH, HI> {
31        IbcRelayWithHandlers::new(self)
32    }
33}