objc2_foundation/generated/
NSHost.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6
7use crate::*;
8
9extern_class!(
10 #[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 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 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 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 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 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 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 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 fn addresses(&self) -> Retained<NSArray<NSString>>;
77
78 #[cfg(feature = "NSString")]
79 #[unsafe(method(localizedName))]
80 #[unsafe(method_family = none)]
81 pub fn localizedName(&self) -> Option<Retained<NSString>>;
82
83 #[deprecated = "Caching no longer supported"]
84 #[unsafe(method(setHostCacheEnabled:))]
85 #[unsafe(method_family = none)]
86 pub fn setHostCacheEnabled(flag: bool);
87
88 #[deprecated = "Caching no longer supported"]
89 #[unsafe(method(isHostCacheEnabled))]
90 #[unsafe(method_family = none)]
91 pub fn isHostCacheEnabled() -> bool;
92
93 #[deprecated = "Caching no longer supported"]
94 #[unsafe(method(flushHostCache))]
95 #[unsafe(method_family = none)]
96 pub fn flushHostCache();
97 );
98}
99
100impl NSHost {
102 extern_methods!(
103 #[unsafe(method(init))]
104 #[unsafe(method_family = init)]
105 pub fn init(this: Allocated<Self>) -> Retained<Self>;
106
107 #[unsafe(method(new))]
108 #[unsafe(method_family = new)]
109 pub fn new() -> Retained<Self>;
110 );
111}
112
113impl DefaultRetained for NSHost {
114 #[inline]
115 fn default_retained() -> Retained<Self> {
116 Self::new()
117 }
118}