objc2_foundation/generated/
NSHost.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    /// DEPRECATION NOTICE
11    ///
12    /// If you’re using `NSHost` to resolve DNS names so that you can connect to a
13    /// service, switch to a connect-by-name API, for example, `nw_connection`.
14    ///
15    /// If you have other DNS resolution needs, switch to
16    /// <dns
17    /// _sd.h>.
18    ///
19    /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nshost?language=objc)
20    #[unsafe(super(NSObject))]
21    #[derive(Debug, PartialEq, Eq, Hash)]
22    #[deprecated = "Use Network framework instead, see deprecation notice in <Foundation/NSHost.h>"]
23    pub struct NSHost;
24);
25
26unsafe impl NSObjectProtocol for NSHost {}
27
28impl NSHost {
29    extern_methods!(
30        #[deprecated = "Use Network framework instead, see deprecation notice in <Foundation/NSHost.h>"]
31        #[unsafe(method(currentHost))]
32        #[unsafe(method_family = none)]
33        pub unsafe fn currentHost() -> Retained<Self>;
34
35        #[cfg(feature = "NSString")]
36        #[deprecated = "Use Network framework instead, see deprecation notice in <Foundation/NSHost.h>"]
37        #[unsafe(method(hostWithName:))]
38        #[unsafe(method_family = none)]
39        pub unsafe fn hostWithName(name: Option<&NSString>) -> Retained<Self>;
40
41        #[cfg(feature = "NSString")]
42        #[deprecated = "Use Network framework instead, see deprecation notice in <Foundation/NSHost.h>"]
43        #[unsafe(method(hostWithAddress:))]
44        #[unsafe(method_family = none)]
45        pub unsafe fn hostWithAddress(address: &NSString) -> Retained<Self>;
46
47        #[deprecated = "Use Network framework instead, see deprecation notice in <Foundation/NSHost.h>"]
48        #[unsafe(method(isEqualToHost:))]
49        #[unsafe(method_family = none)]
50        pub unsafe fn isEqualToHost(&self, a_host: &NSHost) -> bool;
51
52        #[cfg(feature = "NSString")]
53        #[deprecated = "Use Network framework instead, see deprecation notice in <Foundation/NSHost.h>"]
54        #[unsafe(method(name))]
55        #[unsafe(method_family = none)]
56        pub unsafe fn name(&self) -> Option<Retained<NSString>>;
57
58        #[cfg(all(feature = "NSArray", feature = "NSString"))]
59        #[deprecated = "Use Network framework instead, see deprecation notice in <Foundation/NSHost.h>"]
60        #[unsafe(method(names))]
61        #[unsafe(method_family = none)]
62        pub unsafe fn names(&self) -> Retained<NSArray<NSString>>;
63
64        #[cfg(feature = "NSString")]
65        #[deprecated = "Use Network framework instead, see deprecation notice in <Foundation/NSHost.h>"]
66        #[unsafe(method(address))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn address(&self) -> Option<Retained<NSString>>;
69
70        #[cfg(all(feature = "NSArray", feature = "NSString"))]
71        #[deprecated = "Use Network framework instead, see deprecation notice in <Foundation/NSHost.h>"]
72        #[unsafe(method(addresses))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn addresses(&self) -> Retained<NSArray<NSString>>;
75
76        #[cfg(feature = "NSString")]
77        #[unsafe(method(localizedName))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn localizedName(&self) -> Option<Retained<NSString>>;
80
81        #[deprecated = "Caching no longer supported"]
82        #[unsafe(method(setHostCacheEnabled:))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn setHostCacheEnabled(flag: bool);
85
86        #[deprecated = "Caching no longer supported"]
87        #[unsafe(method(isHostCacheEnabled))]
88        #[unsafe(method_family = none)]
89        pub unsafe fn isHostCacheEnabled() -> bool;
90
91        #[deprecated = "Caching no longer supported"]
92        #[unsafe(method(flushHostCache))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn flushHostCache();
95    );
96}
97
98/// Methods declared on superclass `NSObject`.
99impl NSHost {
100    extern_methods!(
101        #[unsafe(method(init))]
102        #[unsafe(method_family = init)]
103        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
104
105        #[unsafe(method(new))]
106        #[unsafe(method_family = new)]
107        pub unsafe fn new() -> Retained<Self>;
108    );
109}