1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
use crate::capability::CapSecret; use crate::prelude::*; use crate::zome::FunctionName; use crate::zome::ZomeName; use holo_hash::AgentPubKey; #[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] pub struct CallRemote { target_agent: AgentPubKey, zome_name: ZomeName, fn_name: FunctionName, cap: Option<CapSecret>, payload: ExternIO, } impl CallRemote { pub fn new( target_agent: AgentPubKey, zome_name: ZomeName, fn_name: FunctionName, cap: Option<CapSecret>, payload: ExternIO, ) -> Self { Self { target_agent, zome_name, fn_name, cap, payload, } } pub fn target_agent_as_ref(&self) -> &AgentPubKey { &self.target_agent } pub fn zome_name_as_ref(&self) -> &ZomeName { &self.zome_name } pub fn fn_name_as_ref(&self) -> &FunctionName { &self.fn_name } pub fn cap_as_ref(&self) -> &Option<CapSecret> { &self.cap } pub fn payload_as_ref(&self) -> &ExternIO { &self.payload } }