objc2_foundation/generated/
NSDistributedLock.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6
7use crate::*;
8
9extern_class!(
10 #[unsafe(super(NSObject))]
12 #[derive(Debug, PartialEq, Eq, Hash)]
13 pub struct NSDistributedLock;
14);
15
16unsafe impl Send for NSDistributedLock {}
17
18unsafe impl Sync for NSDistributedLock {}
19
20extern_conformance!(
21 unsafe impl NSObjectProtocol for NSDistributedLock {}
22);
23
24impl NSDistributedLock {
25 extern_methods!(
26 #[cfg(feature = "NSString")]
27 #[unsafe(method(lockWithPath:))]
28 #[unsafe(method_family = none)]
29 pub unsafe fn lockWithPath(path: &NSString) -> Option<Retained<NSDistributedLock>>;
30
31 #[unsafe(method(init))]
32 #[unsafe(method_family = init)]
33 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
34
35 #[cfg(feature = "NSString")]
36 #[unsafe(method(initWithPath:))]
37 #[unsafe(method_family = init)]
38 pub unsafe fn initWithPath(
39 this: Allocated<Self>,
40 path: &NSString,
41 ) -> Option<Retained<Self>>;
42
43 #[unsafe(method(tryLock))]
44 #[unsafe(method_family = none)]
45 pub unsafe fn tryLock(&self) -> bool;
46
47 #[unsafe(method(unlock))]
48 #[unsafe(method_family = none)]
49 pub unsafe fn unlock(&self);
50
51 #[unsafe(method(breakLock))]
52 #[unsafe(method_family = none)]
53 pub unsafe fn breakLock(&self);
54
55 #[cfg(feature = "NSDate")]
56 #[unsafe(method(lockDate))]
57 #[unsafe(method_family = none)]
58 pub unsafe fn lockDate(&self) -> Retained<NSDate>;
59 );
60}
61
62impl NSDistributedLock {
64 extern_methods!(
65 #[unsafe(method(new))]
66 #[unsafe(method_family = new)]
67 pub unsafe fn new() -> Retained<Self>;
68 );
69}