rust_macios/background_tasks/
bg_app_refresh_task_request.rs1use objc::{msg_send, sel, sel_impl};
2
3use crate::{
4 background_tasks::IBGTaskRequest,
5 foundation::NSString,
6 object,
7 objective_c_runtime::{
8 macros::interface_impl,
9 traits::{FromId, PNSObject},
10 },
11};
12
13object! {
14 unsafe pub struct BGAppRefreshTaskRequest;
16}
17
18#[interface_impl(BGTaskRequest)]
19impl BGAppRefreshTaskRequest {
20 #[method]
22 pub fn init_with_identifier(&mut self, identifier: NSString) -> Self
23 where
24 Self: Sized + FromId,
25 {
26 unsafe { Self::from_id(msg_send![self.m_self(), initWithIdentifier: identifier]) }
27 }
28}
29
30impl Default for BGAppRefreshTaskRequest {
31 fn default() -> Self {
32 Self::m_new()
33 }
34}
35
36impl IBGTaskRequest for BGAppRefreshTaskRequest {}