objc2_foundation/generated/
NSDistributedLock.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6
7use crate::*;
8
9extern_class!(
10    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsdistributedlock?language=objc)
11    #[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
20unsafe impl NSObjectProtocol for NSDistributedLock {}
21
22impl NSDistributedLock {
23    extern_methods!(
24        #[cfg(feature = "NSString")]
25        #[unsafe(method(lockWithPath:))]
26        #[unsafe(method_family = none)]
27        pub unsafe fn lockWithPath(path: &NSString) -> Option<Retained<NSDistributedLock>>;
28
29        #[unsafe(method(init))]
30        #[unsafe(method_family = init)]
31        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
32
33        #[cfg(feature = "NSString")]
34        #[unsafe(method(initWithPath:))]
35        #[unsafe(method_family = init)]
36        pub unsafe fn initWithPath(
37            this: Allocated<Self>,
38            path: &NSString,
39        ) -> Option<Retained<Self>>;
40
41        #[unsafe(method(tryLock))]
42        #[unsafe(method_family = none)]
43        pub unsafe fn tryLock(&self) -> bool;
44
45        #[unsafe(method(unlock))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn unlock(&self);
48
49        #[unsafe(method(breakLock))]
50        #[unsafe(method_family = none)]
51        pub unsafe fn breakLock(&self);
52
53        #[cfg(feature = "NSDate")]
54        #[unsafe(method(lockDate))]
55        #[unsafe(method_family = none)]
56        pub unsafe fn lockDate(&self) -> Retained<NSDate>;
57    );
58}
59
60/// Methods declared on superclass `NSObject`.
61impl NSDistributedLock {
62    extern_methods!(
63        #[unsafe(method(new))]
64        #[unsafe(method_family = new)]
65        pub unsafe fn new() -> Retained<Self>;
66    );
67}