1use crate::{ffi,Setting};
7#[cfg(feature = "v1_54")]
8#[cfg_attr(docsrs, doc(cfg(feature = "v1_54")))]
9use crate::{SettingOvsDpdkLscInterrupt};
10use glib::{prelude::*};
11#[cfg(feature = "v1_20")]
12#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
13use glib::{signal::{connect_raw, SignalHandlerId},translate::*};
14#[cfg(feature = "v1_20")]
15#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
16use std::{boxed::Box as Box_};
17
18glib::wrapper! {
19 #[doc(alias = "NMSettingOvsDpdk")]
82 pub struct SettingOvsDpdk(Object<ffi::NMSettingOvsDpdk, ffi::NMSettingOvsDpdkClass>) @extends Setting;
83
84 match fn {
85 type_ => || ffi::nm_setting_ovs_dpdk_get_type(),
86 }
87}
88
89impl SettingOvsDpdk {
90 #[cfg(feature = "v1_20")]
96 #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
97 #[doc(alias = "nm_setting_ovs_dpdk_new")]
98 pub fn new() -> SettingOvsDpdk {
99 assert_initialized_main_thread!();
100 unsafe {
101 Setting::from_glib_full(ffi::nm_setting_ovs_dpdk_new()).unsafe_cast()
102 }
103 }
104
105 pub fn builder() -> SettingOvsDpdkBuilder {
110 SettingOvsDpdkBuilder::new()
111 }
112
113
114 #[cfg(feature = "v1_20")]
119 #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
120 #[doc(alias = "nm_setting_ovs_dpdk_get_devargs")]
121 #[doc(alias = "get_devargs")]
122 pub fn devargs(&self) -> glib::GString {
123 unsafe {
124 from_glib_none(ffi::nm_setting_ovs_dpdk_get_devargs(self.to_glib_none().0))
125 }
126 }
127
128 #[cfg(feature = "v1_54")]
133 #[cfg_attr(docsrs, doc(cfg(feature = "v1_54")))]
134 #[doc(alias = "nm_setting_ovs_dpdk_get_lsc_interrupt")]
135 #[doc(alias = "get_lsc_interrupt")]
136 #[doc(alias = "lsc-interrupt")]
137 pub fn lsc_interrupt(&self) -> SettingOvsDpdkLscInterrupt {
138 unsafe {
139 from_glib(ffi::nm_setting_ovs_dpdk_get_lsc_interrupt(self.to_glib_none().0))
140 }
141 }
142
143 #[cfg(feature = "v1_36")]
148 #[cfg_attr(docsrs, doc(cfg(feature = "v1_36")))]
149 #[doc(alias = "nm_setting_ovs_dpdk_get_n_rxq")]
150 #[doc(alias = "get_n_rxq")]
151 #[doc(alias = "n-rxq")]
152 pub fn n_rxq(&self) -> u32 {
153 unsafe {
154 ffi::nm_setting_ovs_dpdk_get_n_rxq(self.to_glib_none().0)
155 }
156 }
157
158 #[cfg(feature = "v1_42")]
163 #[cfg_attr(docsrs, doc(cfg(feature = "v1_42")))]
164 #[doc(alias = "nm_setting_ovs_dpdk_get_n_rxq_desc")]
165 #[doc(alias = "get_n_rxq_desc")]
166 #[doc(alias = "n-rxq-desc")]
167 pub fn n_rxq_desc(&self) -> u32 {
168 unsafe {
169 ffi::nm_setting_ovs_dpdk_get_n_rxq_desc(self.to_glib_none().0)
170 }
171 }
172
173 #[cfg(feature = "v1_42")]
178 #[cfg_attr(docsrs, doc(cfg(feature = "v1_42")))]
179 #[doc(alias = "nm_setting_ovs_dpdk_get_n_txq_desc")]
180 #[doc(alias = "get_n_txq_desc")]
181 #[doc(alias = "n-txq-desc")]
182 pub fn n_txq_desc(&self) -> u32 {
183 unsafe {
184 ffi::nm_setting_ovs_dpdk_get_n_txq_desc(self.to_glib_none().0)
185 }
186 }
187
188 #[cfg(feature = "v1_20")]
190 #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
191 pub fn set_devargs(&self, devargs: Option<&str>) {
192 ObjectExt::set_property(self,"devargs", devargs)
193 }
194
195 #[cfg(feature = "v1_54")]
202 #[cfg_attr(docsrs, doc(cfg(feature = "v1_54")))]
203 #[doc(alias = "lsc-interrupt")]
204 pub fn set_lsc_interrupt(&self, lsc_interrupt: i32) {
205 ObjectExt::set_property(self,"lsc-interrupt", lsc_interrupt)
206 }
207
208 #[cfg(feature = "v1_36")]
212 #[cfg_attr(docsrs, doc(cfg(feature = "v1_36")))]
213 #[doc(alias = "n-rxq")]
214 pub fn set_n_rxq(&self, n_rxq: u32) {
215 ObjectExt::set_property(self,"n-rxq", n_rxq)
216 }
217
218 #[cfg(feature = "v1_42")]
224 #[cfg_attr(docsrs, doc(cfg(feature = "v1_42")))]
225 #[doc(alias = "n-rxq-desc")]
226 pub fn set_n_rxq_desc(&self, n_rxq_desc: u32) {
227 ObjectExt::set_property(self,"n-rxq-desc", n_rxq_desc)
228 }
229
230 #[cfg(feature = "v1_42")]
236 #[cfg_attr(docsrs, doc(cfg(feature = "v1_42")))]
237 #[doc(alias = "n-txq-desc")]
238 pub fn set_n_txq_desc(&self, n_txq_desc: u32) {
239 ObjectExt::set_property(self,"n-txq-desc", n_txq_desc)
240 }
241
242 #[cfg(feature = "v1_20")]
243 #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
244 #[doc(alias = "devargs")]
245 pub fn connect_devargs_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
246 unsafe extern "C" fn notify_devargs_trampoline<F: Fn(&SettingOvsDpdk) + 'static>(this: *mut ffi::NMSettingOvsDpdk, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
247 let f: &F = &*(f as *const F);
248 f(&from_glib_borrow(this))
249 }
250 unsafe {
251 let f: Box_<F> = Box_::new(f);
252 connect_raw(self.as_ptr() as *mut _, c"notify::devargs".as_ptr() as *const _,
253 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_devargs_trampoline::<F> as *const ())), Box_::into_raw(f))
254 }
255 }
256
257 #[cfg(feature = "v1_54")]
258 #[cfg_attr(docsrs, doc(cfg(feature = "v1_54")))]
259 #[doc(alias = "lsc-interrupt")]
260 pub fn connect_lsc_interrupt_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
261 unsafe extern "C" fn notify_lsc_interrupt_trampoline<F: Fn(&SettingOvsDpdk) + 'static>(this: *mut ffi::NMSettingOvsDpdk, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
262 let f: &F = &*(f as *const F);
263 f(&from_glib_borrow(this))
264 }
265 unsafe {
266 let f: Box_<F> = Box_::new(f);
267 connect_raw(self.as_ptr() as *mut _, c"notify::lsc-interrupt".as_ptr() as *const _,
268 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_lsc_interrupt_trampoline::<F> as *const ())), Box_::into_raw(f))
269 }
270 }
271
272 #[cfg(feature = "v1_36")]
273 #[cfg_attr(docsrs, doc(cfg(feature = "v1_36")))]
274 #[doc(alias = "n-rxq")]
275 pub fn connect_n_rxq_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
276 unsafe extern "C" fn notify_n_rxq_trampoline<F: Fn(&SettingOvsDpdk) + 'static>(this: *mut ffi::NMSettingOvsDpdk, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
277 let f: &F = &*(f as *const F);
278 f(&from_glib_borrow(this))
279 }
280 unsafe {
281 let f: Box_<F> = Box_::new(f);
282 connect_raw(self.as_ptr() as *mut _, c"notify::n-rxq".as_ptr() as *const _,
283 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_n_rxq_trampoline::<F> as *const ())), Box_::into_raw(f))
284 }
285 }
286
287 #[cfg(feature = "v1_42")]
288 #[cfg_attr(docsrs, doc(cfg(feature = "v1_42")))]
289 #[doc(alias = "n-rxq-desc")]
290 pub fn connect_n_rxq_desc_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
291 unsafe extern "C" fn notify_n_rxq_desc_trampoline<F: Fn(&SettingOvsDpdk) + 'static>(this: *mut ffi::NMSettingOvsDpdk, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
292 let f: &F = &*(f as *const F);
293 f(&from_glib_borrow(this))
294 }
295 unsafe {
296 let f: Box_<F> = Box_::new(f);
297 connect_raw(self.as_ptr() as *mut _, c"notify::n-rxq-desc".as_ptr() as *const _,
298 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_n_rxq_desc_trampoline::<F> as *const ())), Box_::into_raw(f))
299 }
300 }
301
302 #[cfg(feature = "v1_42")]
303 #[cfg_attr(docsrs, doc(cfg(feature = "v1_42")))]
304 #[doc(alias = "n-txq-desc")]
305 pub fn connect_n_txq_desc_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
306 unsafe extern "C" fn notify_n_txq_desc_trampoline<F: Fn(&SettingOvsDpdk) + 'static>(this: *mut ffi::NMSettingOvsDpdk, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
307 let f: &F = &*(f as *const F);
308 f(&from_glib_borrow(this))
309 }
310 unsafe {
311 let f: Box_<F> = Box_::new(f);
312 connect_raw(self.as_ptr() as *mut _, c"notify::n-txq-desc".as_ptr() as *const _,
313 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_n_txq_desc_trampoline::<F> as *const ())), Box_::into_raw(f))
314 }
315 }
316}
317
318#[cfg(feature = "v1_20")]
319#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
320impl Default for SettingOvsDpdk {
321 fn default() -> Self {
322 Self::new()
323 }
324 }
325
326#[must_use = "The builder must be built to be used"]
331pub struct SettingOvsDpdkBuilder {
332 builder: glib::object::ObjectBuilder<'static, SettingOvsDpdk>,
333 }
334
335 impl SettingOvsDpdkBuilder {
336 fn new() -> Self {
337 Self { builder: glib::object::Object::builder() }
338 }
339
340 #[cfg(feature = "v1_20")]
342 #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
343 pub fn devargs(self, devargs: impl Into<glib::GString>) -> Self {
344 Self { builder: self.builder.property("devargs", devargs.into()), }
345 }
346
347 #[cfg(feature = "v1_54")]
354 #[cfg_attr(docsrs, doc(cfg(feature = "v1_54")))]
355 pub fn lsc_interrupt(self, lsc_interrupt: i32) -> Self {
356 Self { builder: self.builder.property("lsc-interrupt", lsc_interrupt), }
357 }
358
359 #[cfg(feature = "v1_36")]
363 #[cfg_attr(docsrs, doc(cfg(feature = "v1_36")))]
364 pub fn n_rxq(self, n_rxq: u32) -> Self {
365 Self { builder: self.builder.property("n-rxq", n_rxq), }
366 }
367
368 #[cfg(feature = "v1_42")]
374 #[cfg_attr(docsrs, doc(cfg(feature = "v1_42")))]
375 pub fn n_rxq_desc(self, n_rxq_desc: u32) -> Self {
376 Self { builder: self.builder.property("n-rxq-desc", n_rxq_desc), }
377 }
378
379 #[cfg(feature = "v1_42")]
385 #[cfg_attr(docsrs, doc(cfg(feature = "v1_42")))]
386 pub fn n_txq_desc(self, n_txq_desc: u32) -> Self {
387 Self { builder: self.builder.property("n-txq-desc", n_txq_desc), }
388 }
389
390 #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
393 pub fn build(self) -> SettingOvsDpdk {
394assert_initialized_main_thread!();
395 self.builder.build() }
396}