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::typedValue::TypedValue;
7pub struct CallResourceMethodV1 {
8    pub resource: Uuid,
9    pub method: String,
10    pub args: TypedValue,
11}
12
13
14impl CallResourceMethodV1 {
15    pub fn create(resource: Uuid, method: String, args: TypedValue) -> Box<SyscallRequest<Self>> {
16        Box::new(SyscallRequest {
17            size: size_of::<Self>(),
18            uuid: crate::uuid::Uuid::from_u128(0xbce7baa2_c3e2_4f7f_9d42_42c94065f5f0),
19            payload: Self {
20                resource,
21                method,
22                args,
23            },
24        })
25    }
26}