objc2_speech/generated/
SFSpeechLanguageModel.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11 #[unsafe(super(NSObject))]
17 #[derive(Debug, PartialEq, Eq, Hash)]
18 pub struct SFSpeechLanguageModelConfiguration;
19);
20
21unsafe impl Send for SFSpeechLanguageModelConfiguration {}
22
23unsafe impl Sync for SFSpeechLanguageModelConfiguration {}
24
25extern_conformance!(
26 unsafe impl NSCoding for SFSpeechLanguageModelConfiguration {}
27);
28
29extern_conformance!(
30 unsafe impl NSCopying for SFSpeechLanguageModelConfiguration {}
31);
32
33unsafe impl CopyingHelper for SFSpeechLanguageModelConfiguration {
34 type Result = Self;
35}
36
37extern_conformance!(
38 unsafe impl NSObjectProtocol for SFSpeechLanguageModelConfiguration {}
39);
40
41extern_conformance!(
42 unsafe impl NSSecureCoding for SFSpeechLanguageModelConfiguration {}
43);
44
45impl SFSpeechLanguageModelConfiguration {
46 extern_methods!(
47 #[unsafe(method(languageModel))]
55 #[unsafe(method_family = none)]
56 pub unsafe fn languageModel(&self) -> Retained<NSURL>;
57
58 #[unsafe(method(vocabulary))]
66 #[unsafe(method_family = none)]
67 pub unsafe fn vocabulary(&self) -> Option<Retained<NSURL>>;
68
69 #[unsafe(method(weight))]
77 #[unsafe(method_family = none)]
78 pub unsafe fn weight(&self) -> Option<Retained<NSNumber>>;
79
80 #[unsafe(method(initWithLanguageModel:))]
82 #[unsafe(method_family = init)]
83 pub unsafe fn initWithLanguageModel(
84 this: Allocated<Self>,
85 language_model: &NSURL,
86 ) -> Retained<Self>;
87
88 #[unsafe(method(initWithLanguageModel:vocabulary:))]
90 #[unsafe(method_family = init)]
91 pub unsafe fn initWithLanguageModel_vocabulary(
92 this: Allocated<Self>,
93 language_model: &NSURL,
94 vocabulary: Option<&NSURL>,
95 ) -> Retained<Self>;
96
97 #[unsafe(method(initWithLanguageModel:vocabulary:weight:))]
99 #[unsafe(method_family = init)]
100 pub unsafe fn initWithLanguageModel_vocabulary_weight(
101 this: Allocated<Self>,
102 language_model: &NSURL,
103 vocabulary: Option<&NSURL>,
104 weight: Option<&NSNumber>,
105 ) -> Retained<Self>;
106 );
107}
108
109impl SFSpeechLanguageModelConfiguration {
111 extern_methods!(
112 #[unsafe(method(init))]
113 #[unsafe(method_family = init)]
114 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
115
116 #[unsafe(method(new))]
117 #[unsafe(method_family = new)]
118 pub unsafe fn new() -> Retained<Self>;
119 );
120}
121
122extern_class!(
123 #[unsafe(super(NSObject))]
129 #[derive(Debug, PartialEq, Eq, Hash)]
130 pub struct SFSpeechLanguageModel;
131);
132
133extern_conformance!(
134 unsafe impl NSObjectProtocol for SFSpeechLanguageModel {}
135);
136
137impl SFSpeechLanguageModel {
138 extern_methods!(
139 #[cfg(feature = "block2")]
140 #[deprecated]
141 #[unsafe(method(prepareCustomLanguageModelForUrl:clientIdentifier:configuration:completion:))]
142 #[unsafe(method_family = none)]
143 pub unsafe fn prepareCustomLanguageModelForUrl_clientIdentifier_configuration_completion(
144 asset: &NSURL,
145 client_identifier: &NSString,
146 configuration: &SFSpeechLanguageModelConfiguration,
147 completion: &block2::DynBlock<dyn Fn(*mut NSError)>,
148 );
149
150 #[cfg(feature = "block2")]
151 #[deprecated]
152 #[unsafe(method(prepareCustomLanguageModelForUrl:clientIdentifier:configuration:ignoresCache:completion:))]
153 #[unsafe(method_family = none)]
154 pub unsafe fn prepareCustomLanguageModelForUrl_clientIdentifier_configuration_ignoresCache_completion(
155 asset: &NSURL,
156 client_identifier: &NSString,
157 configuration: &SFSpeechLanguageModelConfiguration,
158 ignores_cache: bool,
159 completion: &block2::DynBlock<dyn Fn(*mut NSError)>,
160 );
161
162 #[cfg(feature = "block2")]
163 #[unsafe(method(prepareCustomLanguageModelForUrl:configuration:completion:))]
170 #[unsafe(method_family = none)]
171 pub unsafe fn prepareCustomLanguageModelForUrl_configuration_completion(
172 asset: &NSURL,
173 configuration: &SFSpeechLanguageModelConfiguration,
174 completion: &block2::DynBlock<dyn Fn(*mut NSError)>,
175 );
176
177 #[cfg(feature = "block2")]
178 #[unsafe(method(prepareCustomLanguageModelForUrl:configuration:ignoresCache:completion:))]
186 #[unsafe(method_family = none)]
187 pub unsafe fn prepareCustomLanguageModelForUrl_configuration_ignoresCache_completion(
188 asset: &NSURL,
189 configuration: &SFSpeechLanguageModelConfiguration,
190 ignores_cache: bool,
191 completion: &block2::DynBlock<dyn Fn(*mut NSError)>,
192 );
193 );
194}
195
196impl SFSpeechLanguageModel {
198 extern_methods!(
199 #[unsafe(method(init))]
200 #[unsafe(method_family = init)]
201 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
202
203 #[unsafe(method(new))]
204 #[unsafe(method_family = new)]
205 pub unsafe fn new() -> Retained<Self>;
206 );
207}