pub struct ResourceRef<'a> { /* private fields */ }Expand description
A borrowed reference to a Resource.
This is a non-owning view that can be used for read-only operations. It does NOT call destroy when dropped and should only be used while the underlying Resource is still alive.
Obtained from Tasker::resource().
Implementations§
Source§impl<'a> ResourceRef<'a>
impl<'a> ResourceRef<'a>
Sourcepub fn get_default_recognition_param(
&self,
reco_type: &str,
) -> MaaResult<Option<Value>>
pub fn get_default_recognition_param( &self, reco_type: &str, ) -> MaaResult<Option<Value>>
Get valid default parameters for a recognition type as JSON.
Sourcepub fn get_default_action_param(
&self,
action_type: &str,
) -> MaaResult<Option<Value>>
pub fn get_default_action_param( &self, action_type: &str, ) -> MaaResult<Option<Value>>
Get valid default parameters for an action type as JSON.
Sourcepub fn get_node_data(&self, node_name: &str) -> MaaResult<Option<String>>
pub fn get_node_data(&self, node_name: &str) -> MaaResult<Option<String>>
Get node data as JSON string.
Sourcepub fn raw(&self) -> *mut MaaResource
pub fn raw(&self) -> *mut MaaResource
Get the raw handle.
Auto Trait Implementations§
impl<'a> Freeze for ResourceRef<'a>
impl<'a> RefUnwindSafe for ResourceRef<'a>
impl<'a> !Send for ResourceRef<'a>
impl<'a> !Sync for ResourceRef<'a>
impl<'a> Unpin for ResourceRef<'a>
impl<'a> UnwindSafe for ResourceRef<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more