Skip to main content

MatiOS_SDK/syscalls/resources/
call_resource_method_v1.rs

1use crate::syscalls::SyscallRequest;
2use crate::uuid::Uuid;
3use alloc::boxed::Box;
4use alloc::string::String;
5use alloc::vec::Vec;
6use crate::typed_value::TypedValue;
7pub struct CallResourceMethodV1 {
8    pub resource: Uuid,
9    pub method: String,
10    pub args: TypedValue,
11}
12
13pub struct CallResourceMethodV1Response {
14    pub value: TypedValue
15
16}
17impl CallResourceMethodV1 {
18    pub fn create(resource: Uuid, method: String, args: TypedValue) -> Box<SyscallRequest<Self>> {
19        Box::new(SyscallRequest {
20            size: size_of::<Self>(),
21            uuid: crate::uuid::Uuid::from_u128(0xbce7baa2_c3e2_4f7f_9d42_42c94065f5f0),
22            payload: Self {
23                resource,
24                method,
25                args,
26            },
27        })
28    }
29}