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
26extern_conformance!(
27    unsafe impl NSObjectProtocol for NSHost {}
28);
29
30impl NSHost {
31    extern_methods!(
32        #[deprecated = "Use Network framework instead, see deprecation notice in <Foundation/NSHost.h>"]
33        #[unsafe(method(currentHost))]
34        #[unsafe(method_family = none)]
35        pub unsafe fn currentHost() -> Retained<Self>;
36
37        #[cfg(feature = "NSString")]
38        #[deprecated = "Use Network framework instead, see deprecation notice in <Foundation/NSHost.h>"]
39        #[unsafe(method(hostWithName:))]
40        #[unsafe(method_family = none)]
41        pub unsafe fn hostWithName(name: Option<&NSString>) -> Retained<Self>;
42
43        #[cfg(feature = "NSString")]
44        #[deprecated = "Use Network framework instead, see deprecation notice in <Foundation/NSHost.h>"]
45        #[unsafe(method(hostWithAddress:))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn hostWithAddress(address: &NSString) -> Retained<Self>;
48
49        #[deprecated = "Use Network framework instead, see deprecation notice in <Foundation/NSHost.h>"]
50        #[unsafe(method(isEqualToHost:))]
51        #[unsafe(method_family = none)]
52        pub unsafe fn isEqualToHost(&self, a_host: &NSHost) -> bool;
53
54        #[cfg(feature = "NSString")]
55        #[deprecated = "Use Network framework instead, see deprecation notice in <Foundation/NSHost.h>"]
56        #[unsafe(method(name))]
57        #[unsafe(method_family = none)]
58        pub unsafe fn name(&self) -> Option<Retained<NSString>>;
59
60        #[cfg(all(feature = "NSArray", feature = "NSString"))]
61        #[deprecated = "Use Network framework instead, see deprecation notice in <Foundation/NSHost.h>"]
62        #[unsafe(method(names))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn names(&self) -> Retained<NSArray<NSString>>;
65
66        #[cfg(feature = "NSString")]
67        #[deprecated = "Use Network framework instead, see deprecation notice in <Foundation/NSHost.h>"]
68        #[unsafe(method(address))]
69        #[unsafe(method_family = none)]
70        pub unsafe fn address(&self) -> Option<Retained<NSString>>;
71
72        #[cfg(all(feature = "NSArray", feature = "NSString"))]
73        #[deprecated = "Use Network framework instead, see deprecation notice in <Foundation/NSHost.h>"]
74        #[unsafe(method(addresses))]
75        #[unsafe(method_family = none)]
76        pub unsafe fn addresses(&self) -> Retained<NSArray<NSString>>;
77
78        #[cfg(feature = "NSString")]
79        #[unsafe(method(localizedName))]
80        #[unsafe(method_family = none)]
81        pub unsafe fn localizedName(&self) -> Option<Retained<NSString>>;
82
83        #[deprecated = "Caching no longer supported"]
84        #[unsafe(method(setHostCacheEnabled:))]
85        #[unsafe(method_family = none)]
86        pub unsafe fn setHostCacheEnabled(flag: bool);
87
88        #[deprecated = "Caching no longer supported"]
89        #[unsafe(method(isHostCacheEnabled))]
90        #[unsafe(method_family = none)]
91        pub unsafe fn isHostCacheEnabled() -> bool;
92
93        #[deprecated = "Caching no longer supported"]
94        #[unsafe(method(flushHostCache))]
95        #[unsafe(method_family = none)]
96        pub unsafe fn flushHostCache();
97    );
98}
99
100/// Methods declared on superclass `NSObject`.
101impl NSHost {
102    extern_methods!(
103        #[unsafe(method(init))]
104        #[unsafe(method_family = init)]
105        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
106
107        #[unsafe(method(new))]
108        #[unsafe(method_family = new)]
109        pub unsafe fn new() -> Retained<Self>;
110    );
111}