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 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 fn initWithPath(this: Allocated<Self>, path: &NSString) -> Option<Retained<Self>>;
39
40 #[unsafe(method(tryLock))]
41 #[unsafe(method_family = none)]
42 pub fn tryLock(&self) -> bool;
43
44 #[unsafe(method(unlock))]
45 #[unsafe(method_family = none)]
46 pub fn unlock(&self);
47
48 #[unsafe(method(breakLock))]
49 #[unsafe(method_family = none)]
50 pub fn breakLock(&self);
51
52 #[cfg(feature = "NSDate")]
53 #[unsafe(method(lockDate))]
54 #[unsafe(method_family = none)]
55 pub fn lockDate(&self) -> Retained<NSDate>;
56 );
57}
58
59impl NSDistributedLock {
61 extern_methods!(
62 #[unsafe(method(new))]
63 #[unsafe(method_family = new)]
64 pub unsafe fn new() -> Retained<Self>;
65 );
66}