gio/auto/
inet_address.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// DO NOT EDIT
4
5use crate::{ffi, SocketFamily};
6use glib::{
7    prelude::*,
8    signal::{connect_raw, SignalHandlerId},
9    translate::*,
10};
11use std::boxed::Box as Box_;
12
13glib::wrapper! {
14    /// `GInetAddress` represents an IPv4 or IPv6 internet address. Use
15    /// [`ResolverExt::lookup_by_name()`][crate::prelude::ResolverExt::lookup_by_name()] or
16    /// [`ResolverExt::lookup_by_name_async()`][crate::prelude::ResolverExt::lookup_by_name_async()] to look up the `GInetAddress` for
17    /// a hostname. Use [`ResolverExt::lookup_by_address()`][crate::prelude::ResolverExt::lookup_by_address()] or
18    /// [`ResolverExt::lookup_by_address_async()`][crate::prelude::ResolverExt::lookup_by_address_async()] to look up the hostname for a
19    /// `GInetAddress`.
20    ///
21    /// To actually connect to a remote host, you will need a
22    /// [`InetSocketAddress`][crate::InetSocketAddress] (which includes a `GInetAddress` as well as a
23    /// port number).
24    ///
25    /// ## Properties
26    ///
27    ///
28    /// #### `bytes`
29    ///  The raw address data.
30    ///
31    /// Readable | Writeable | Construct Only
32    ///
33    ///
34    /// #### `family`
35    ///  The address family (IPv4 or IPv6).
36    ///
37    /// Readable | Writeable | Construct Only
38    ///
39    ///
40    /// #### `flowinfo`
41    ///  The flowinfo for an IPv6 address.
42    /// See [`InetAddressExt::flowinfo()`][crate::prelude::InetAddressExt::flowinfo()].
43    ///
44    /// Readable | Writeable | Construct Only
45    ///
46    ///
47    /// #### `is-any`
48    ///  Whether this is the "any" address for its family.
49    /// See g_inet_address_get_is_any().
50    ///
51    /// Readable
52    ///
53    ///
54    /// #### `is-link-local`
55    ///  Whether this is a link-local address.
56    /// See g_inet_address_get_is_link_local().
57    ///
58    /// Readable
59    ///
60    ///
61    /// #### `is-loopback`
62    ///  Whether this is the loopback address for its family.
63    /// See g_inet_address_get_is_loopback().
64    ///
65    /// Readable
66    ///
67    ///
68    /// #### `is-mc-global`
69    ///  Whether this is a global multicast address.
70    /// See g_inet_address_get_is_mc_global().
71    ///
72    /// Readable
73    ///
74    ///
75    /// #### `is-mc-link-local`
76    ///  Whether this is a link-local multicast address.
77    /// See g_inet_address_get_is_mc_link_local().
78    ///
79    /// Readable
80    ///
81    ///
82    /// #### `is-mc-node-local`
83    ///  Whether this is a node-local multicast address.
84    /// See g_inet_address_get_is_mc_node_local().
85    ///
86    /// Readable
87    ///
88    ///
89    /// #### `is-mc-org-local`
90    ///  Whether this is an organization-local multicast address.
91    /// See g_inet_address_get_is_mc_org_local().
92    ///
93    /// Readable
94    ///
95    ///
96    /// #### `is-mc-site-local`
97    ///  Whether this is a site-local multicast address.
98    /// See g_inet_address_get_is_mc_site_local().
99    ///
100    /// Readable
101    ///
102    ///
103    /// #### `is-multicast`
104    ///  Whether this is a multicast address.
105    /// See g_inet_address_get_is_multicast().
106    ///
107    /// Readable
108    ///
109    ///
110    /// #### `is-site-local`
111    ///  Whether this is a site-local address.
112    /// See g_inet_address_get_is_loopback().
113    ///
114    /// Readable
115    ///
116    ///
117    /// #### `scope-id`
118    ///  The scope-id for an IPv6 address.
119    /// See [`InetAddressExt::scope_id()`][crate::prelude::InetAddressExt::scope_id()].
120    ///
121    /// Readable | Writeable | Construct Only
122    ///
123    /// # Implements
124    ///
125    /// [`InetAddressExt`][trait@crate::prelude::InetAddressExt], [`trait@glib::ObjectExt`], [`InetAddressExtManual`][trait@crate::prelude::InetAddressExtManual]
126    #[doc(alias = "GInetAddress")]
127    pub struct InetAddress(Object<ffi::GInetAddress, ffi::GInetAddressClass>);
128
129    match fn {
130        type_ => || ffi::g_inet_address_get_type(),
131    }
132}
133
134impl InetAddress {
135    pub const NONE: Option<&'static InetAddress> = None;
136
137    /// Creates a #GInetAddress for the "any" address (unassigned/"don't
138    /// care") for @family.
139    /// ## `family`
140    /// the address family
141    ///
142    /// # Returns
143    ///
144    /// a new #GInetAddress corresponding to the "any" address
145    /// for @family.
146    ///     Free the returned object with g_object_unref().
147    #[doc(alias = "g_inet_address_new_any")]
148    pub fn new_any(family: SocketFamily) -> InetAddress {
149        unsafe { from_glib_full(ffi::g_inet_address_new_any(family.into_glib())) }
150    }
151
152    /// Parses @string as an IP address and creates a new #GInetAddress.
153    ///
154    /// If @address is an IPv6 address, it can also contain a scope ID
155    /// (separated from the address by a `%`). Note that currently this
156    /// behavior is platform specific. This may change in a future release.
157    /// ## `string`
158    /// a string representation of an IP address
159    ///
160    /// # Returns
161    ///
162    /// a new #GInetAddress corresponding
163    /// to @string, or [`None`] if @string could not be parsed.
164    ///     Free the returned object with g_object_unref().
165    #[doc(alias = "g_inet_address_new_from_string")]
166    #[doc(alias = "new_from_string")]
167    pub fn from_string(string: &str) -> Option<InetAddress> {
168        unsafe { from_glib_full(ffi::g_inet_address_new_from_string(string.to_glib_none().0)) }
169    }
170
171    /// Creates a #GInetAddress for the loopback address for @family.
172    /// ## `family`
173    /// the address family
174    ///
175    /// # Returns
176    ///
177    /// a new #GInetAddress corresponding to the loopback address
178    /// for @family.
179    ///     Free the returned object with g_object_unref().
180    #[doc(alias = "g_inet_address_new_loopback")]
181    pub fn new_loopback(family: SocketFamily) -> InetAddress {
182        unsafe { from_glib_full(ffi::g_inet_address_new_loopback(family.into_glib())) }
183    }
184}
185
186impl std::fmt::Display for InetAddress {
187    #[inline]
188    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
189        f.write_str(&InetAddressExt::to_str(self))
190    }
191}
192
193unsafe impl Send for InetAddress {}
194unsafe impl Sync for InetAddress {}
195
196/// Trait containing all [`struct@InetAddress`] methods.
197///
198/// # Implementors
199///
200/// [`InetAddress`][struct@crate::InetAddress]
201pub trait InetAddressExt: IsA<InetAddress> + 'static {
202    #[doc(alias = "g_inet_address_equal")]
203    fn equal(&self, other_address: &impl IsA<InetAddress>) -> bool {
204        unsafe {
205            from_glib(ffi::g_inet_address_equal(
206                self.as_ref().to_glib_none().0,
207                other_address.as_ref().to_glib_none().0,
208            ))
209        }
210    }
211
212    /// Gets @self's family
213    ///
214    /// # Returns
215    ///
216    /// @self's family
217    #[doc(alias = "g_inet_address_get_family")]
218    #[doc(alias = "get_family")]
219    fn family(&self) -> SocketFamily {
220        unsafe {
221            from_glib(ffi::g_inet_address_get_family(
222                self.as_ref().to_glib_none().0,
223            ))
224        }
225    }
226
227    /// Gets the value of [`flowinfo`][struct@crate::InetAddress#flowinfo].
228    ///
229    /// # Returns
230    ///
231    /// The flowinfo for the address, `0` if unset or not IPv6 address.
232    #[cfg(feature = "v2_86")]
233    #[cfg_attr(docsrs, doc(cfg(feature = "v2_86")))]
234    #[doc(alias = "g_inet_address_get_flowinfo")]
235    #[doc(alias = "get_flowinfo")]
236    fn flowinfo(&self) -> u32 {
237        unsafe { ffi::g_inet_address_get_flowinfo(self.as_ref().to_glib_none().0) }
238    }
239
240    /// Tests whether @self is the "any" address for its family.
241    ///
242    /// # Returns
243    ///
244    /// [`true`] if @self is the "any" address for its family.
245    #[doc(alias = "g_inet_address_get_is_any")]
246    #[doc(alias = "get_is_any")]
247    #[doc(alias = "is-any")]
248    fn is_any(&self) -> bool {
249        unsafe {
250            from_glib(ffi::g_inet_address_get_is_any(
251                self.as_ref().to_glib_none().0,
252            ))
253        }
254    }
255
256    /// Tests whether @self is a link-local address (that is, if it
257    /// identifies a host on a local network that is not connected to the
258    /// Internet).
259    ///
260    /// # Returns
261    ///
262    /// [`true`] if @self is a link-local address.
263    #[doc(alias = "g_inet_address_get_is_link_local")]
264    #[doc(alias = "get_is_link_local")]
265    #[doc(alias = "is-link-local")]
266    fn is_link_local(&self) -> bool {
267        unsafe {
268            from_glib(ffi::g_inet_address_get_is_link_local(
269                self.as_ref().to_glib_none().0,
270            ))
271        }
272    }
273
274    /// Tests whether @self is the loopback address for its family.
275    ///
276    /// # Returns
277    ///
278    /// [`true`] if @self is the loopback address for its family.
279    #[doc(alias = "g_inet_address_get_is_loopback")]
280    #[doc(alias = "get_is_loopback")]
281    #[doc(alias = "is-loopback")]
282    fn is_loopback(&self) -> bool {
283        unsafe {
284            from_glib(ffi::g_inet_address_get_is_loopback(
285                self.as_ref().to_glib_none().0,
286            ))
287        }
288    }
289
290    /// Tests whether @self is a global multicast address.
291    ///
292    /// # Returns
293    ///
294    /// [`true`] if @self is a global multicast address.
295    #[doc(alias = "g_inet_address_get_is_mc_global")]
296    #[doc(alias = "get_is_mc_global")]
297    #[doc(alias = "is-mc-global")]
298    fn is_mc_global(&self) -> bool {
299        unsafe {
300            from_glib(ffi::g_inet_address_get_is_mc_global(
301                self.as_ref().to_glib_none().0,
302            ))
303        }
304    }
305
306    /// Tests whether @self is a link-local multicast address.
307    ///
308    /// # Returns
309    ///
310    /// [`true`] if @self is a link-local multicast address.
311    #[doc(alias = "g_inet_address_get_is_mc_link_local")]
312    #[doc(alias = "get_is_mc_link_local")]
313    #[doc(alias = "is-mc-link-local")]
314    fn is_mc_link_local(&self) -> bool {
315        unsafe {
316            from_glib(ffi::g_inet_address_get_is_mc_link_local(
317                self.as_ref().to_glib_none().0,
318            ))
319        }
320    }
321
322    /// Tests whether @self is a node-local multicast address.
323    ///
324    /// # Returns
325    ///
326    /// [`true`] if @self is a node-local multicast address.
327    #[doc(alias = "g_inet_address_get_is_mc_node_local")]
328    #[doc(alias = "get_is_mc_node_local")]
329    #[doc(alias = "is-mc-node-local")]
330    fn is_mc_node_local(&self) -> bool {
331        unsafe {
332            from_glib(ffi::g_inet_address_get_is_mc_node_local(
333                self.as_ref().to_glib_none().0,
334            ))
335        }
336    }
337
338    /// Tests whether @self is an organization-local multicast address.
339    ///
340    /// # Returns
341    ///
342    /// [`true`] if @self is an organization-local multicast address.
343    #[doc(alias = "g_inet_address_get_is_mc_org_local")]
344    #[doc(alias = "get_is_mc_org_local")]
345    #[doc(alias = "is-mc-org-local")]
346    fn is_mc_org_local(&self) -> bool {
347        unsafe {
348            from_glib(ffi::g_inet_address_get_is_mc_org_local(
349                self.as_ref().to_glib_none().0,
350            ))
351        }
352    }
353
354    /// Tests whether @self is a site-local multicast address.
355    ///
356    /// # Returns
357    ///
358    /// [`true`] if @self is a site-local multicast address.
359    #[doc(alias = "g_inet_address_get_is_mc_site_local")]
360    #[doc(alias = "get_is_mc_site_local")]
361    #[doc(alias = "is-mc-site-local")]
362    fn is_mc_site_local(&self) -> bool {
363        unsafe {
364            from_glib(ffi::g_inet_address_get_is_mc_site_local(
365                self.as_ref().to_glib_none().0,
366            ))
367        }
368    }
369
370    /// Tests whether @self is a multicast address.
371    ///
372    /// # Returns
373    ///
374    /// [`true`] if @self is a multicast address.
375    #[doc(alias = "g_inet_address_get_is_multicast")]
376    #[doc(alias = "get_is_multicast")]
377    #[doc(alias = "is-multicast")]
378    fn is_multicast(&self) -> bool {
379        unsafe {
380            from_glib(ffi::g_inet_address_get_is_multicast(
381                self.as_ref().to_glib_none().0,
382            ))
383        }
384    }
385
386    /// Tests whether @self is a site-local address such as 10.0.0.1
387    /// (that is, the address identifies a host on a local network that can
388    /// not be reached directly from the Internet, but which may have
389    /// outgoing Internet connectivity via a NAT or firewall).
390    ///
391    /// # Returns
392    ///
393    /// [`true`] if @self is a site-local address.
394    #[doc(alias = "g_inet_address_get_is_site_local")]
395    #[doc(alias = "get_is_site_local")]
396    #[doc(alias = "is-site-local")]
397    fn is_site_local(&self) -> bool {
398        unsafe {
399            from_glib(ffi::g_inet_address_get_is_site_local(
400                self.as_ref().to_glib_none().0,
401            ))
402        }
403    }
404
405    /// Gets the size of the native raw binary address for @self. This
406    /// is the size of the data that you get from g_inet_address_to_bytes().
407    ///
408    /// # Returns
409    ///
410    /// the number of bytes used for the native version of @self.
411    #[doc(alias = "g_inet_address_get_native_size")]
412    #[doc(alias = "get_native_size")]
413    fn native_size(&self) -> usize {
414        unsafe { ffi::g_inet_address_get_native_size(self.as_ref().to_glib_none().0) }
415    }
416
417    /// Gets the value of [`scope-id`][struct@crate::InetAddress#scope-id].
418    ///
419    /// # Returns
420    ///
421    /// The scope-id for the address, `0` if unset or not IPv6 address.
422    #[cfg(feature = "v2_86")]
423    #[cfg_attr(docsrs, doc(cfg(feature = "v2_86")))]
424    #[doc(alias = "g_inet_address_get_scope_id")]
425    #[doc(alias = "get_scope_id")]
426    #[doc(alias = "scope-id")]
427    fn scope_id(&self) -> u32 {
428        unsafe { ffi::g_inet_address_get_scope_id(self.as_ref().to_glib_none().0) }
429    }
430
431    /// Converts @self to string form.
432    ///
433    /// # Returns
434    ///
435    /// a representation of @self as a string, which should be
436    /// freed after use.
437    #[doc(alias = "g_inet_address_to_string")]
438    #[doc(alias = "to_string")]
439    fn to_str(&self) -> glib::GString {
440        unsafe {
441            from_glib_full(ffi::g_inet_address_to_string(
442                self.as_ref().to_glib_none().0,
443            ))
444        }
445    }
446
447    //fn bytes(&self) -> /*Unimplemented*/Basic: Pointer {
448    //    ObjectExt::property(self.as_ref(), "bytes")
449    //}
450
451    #[doc(alias = "is-any")]
452    fn connect_is_any_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
453        unsafe extern "C" fn notify_is_any_trampoline<
454            P: IsA<InetAddress>,
455            F: Fn(&P) + Send + Sync + 'static,
456        >(
457            this: *mut ffi::GInetAddress,
458            _param_spec: glib::ffi::gpointer,
459            f: glib::ffi::gpointer,
460        ) {
461            let f: &F = &*(f as *const F);
462            f(InetAddress::from_glib_borrow(this).unsafe_cast_ref())
463        }
464        unsafe {
465            let f: Box_<F> = Box_::new(f);
466            connect_raw(
467                self.as_ptr() as *mut _,
468                c"notify::is-any".as_ptr() as *const _,
469                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
470                    notify_is_any_trampoline::<Self, F> as *const (),
471                )),
472                Box_::into_raw(f),
473            )
474        }
475    }
476
477    #[doc(alias = "is-link-local")]
478    fn connect_is_link_local_notify<F: Fn(&Self) + Send + Sync + 'static>(
479        &self,
480        f: F,
481    ) -> SignalHandlerId {
482        unsafe extern "C" fn notify_is_link_local_trampoline<
483            P: IsA<InetAddress>,
484            F: Fn(&P) + Send + Sync + 'static,
485        >(
486            this: *mut ffi::GInetAddress,
487            _param_spec: glib::ffi::gpointer,
488            f: glib::ffi::gpointer,
489        ) {
490            let f: &F = &*(f as *const F);
491            f(InetAddress::from_glib_borrow(this).unsafe_cast_ref())
492        }
493        unsafe {
494            let f: Box_<F> = Box_::new(f);
495            connect_raw(
496                self.as_ptr() as *mut _,
497                c"notify::is-link-local".as_ptr() as *const _,
498                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
499                    notify_is_link_local_trampoline::<Self, F> as *const (),
500                )),
501                Box_::into_raw(f),
502            )
503        }
504    }
505
506    #[doc(alias = "is-loopback")]
507    fn connect_is_loopback_notify<F: Fn(&Self) + Send + Sync + 'static>(
508        &self,
509        f: F,
510    ) -> SignalHandlerId {
511        unsafe extern "C" fn notify_is_loopback_trampoline<
512            P: IsA<InetAddress>,
513            F: Fn(&P) + Send + Sync + 'static,
514        >(
515            this: *mut ffi::GInetAddress,
516            _param_spec: glib::ffi::gpointer,
517            f: glib::ffi::gpointer,
518        ) {
519            let f: &F = &*(f as *const F);
520            f(InetAddress::from_glib_borrow(this).unsafe_cast_ref())
521        }
522        unsafe {
523            let f: Box_<F> = Box_::new(f);
524            connect_raw(
525                self.as_ptr() as *mut _,
526                c"notify::is-loopback".as_ptr() as *const _,
527                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
528                    notify_is_loopback_trampoline::<Self, F> as *const (),
529                )),
530                Box_::into_raw(f),
531            )
532        }
533    }
534
535    #[doc(alias = "is-mc-global")]
536    fn connect_is_mc_global_notify<F: Fn(&Self) + Send + Sync + 'static>(
537        &self,
538        f: F,
539    ) -> SignalHandlerId {
540        unsafe extern "C" fn notify_is_mc_global_trampoline<
541            P: IsA<InetAddress>,
542            F: Fn(&P) + Send + Sync + 'static,
543        >(
544            this: *mut ffi::GInetAddress,
545            _param_spec: glib::ffi::gpointer,
546            f: glib::ffi::gpointer,
547        ) {
548            let f: &F = &*(f as *const F);
549            f(InetAddress::from_glib_borrow(this).unsafe_cast_ref())
550        }
551        unsafe {
552            let f: Box_<F> = Box_::new(f);
553            connect_raw(
554                self.as_ptr() as *mut _,
555                c"notify::is-mc-global".as_ptr() as *const _,
556                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
557                    notify_is_mc_global_trampoline::<Self, F> as *const (),
558                )),
559                Box_::into_raw(f),
560            )
561        }
562    }
563
564    #[doc(alias = "is-mc-link-local")]
565    fn connect_is_mc_link_local_notify<F: Fn(&Self) + Send + Sync + 'static>(
566        &self,
567        f: F,
568    ) -> SignalHandlerId {
569        unsafe extern "C" fn notify_is_mc_link_local_trampoline<
570            P: IsA<InetAddress>,
571            F: Fn(&P) + Send + Sync + 'static,
572        >(
573            this: *mut ffi::GInetAddress,
574            _param_spec: glib::ffi::gpointer,
575            f: glib::ffi::gpointer,
576        ) {
577            let f: &F = &*(f as *const F);
578            f(InetAddress::from_glib_borrow(this).unsafe_cast_ref())
579        }
580        unsafe {
581            let f: Box_<F> = Box_::new(f);
582            connect_raw(
583                self.as_ptr() as *mut _,
584                c"notify::is-mc-link-local".as_ptr() as *const _,
585                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
586                    notify_is_mc_link_local_trampoline::<Self, F> as *const (),
587                )),
588                Box_::into_raw(f),
589            )
590        }
591    }
592
593    #[doc(alias = "is-mc-node-local")]
594    fn connect_is_mc_node_local_notify<F: Fn(&Self) + Send + Sync + 'static>(
595        &self,
596        f: F,
597    ) -> SignalHandlerId {
598        unsafe extern "C" fn notify_is_mc_node_local_trampoline<
599            P: IsA<InetAddress>,
600            F: Fn(&P) + Send + Sync + 'static,
601        >(
602            this: *mut ffi::GInetAddress,
603            _param_spec: glib::ffi::gpointer,
604            f: glib::ffi::gpointer,
605        ) {
606            let f: &F = &*(f as *const F);
607            f(InetAddress::from_glib_borrow(this).unsafe_cast_ref())
608        }
609        unsafe {
610            let f: Box_<F> = Box_::new(f);
611            connect_raw(
612                self.as_ptr() as *mut _,
613                c"notify::is-mc-node-local".as_ptr() as *const _,
614                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
615                    notify_is_mc_node_local_trampoline::<Self, F> as *const (),
616                )),
617                Box_::into_raw(f),
618            )
619        }
620    }
621
622    #[doc(alias = "is-mc-org-local")]
623    fn connect_is_mc_org_local_notify<F: Fn(&Self) + Send + Sync + 'static>(
624        &self,
625        f: F,
626    ) -> SignalHandlerId {
627        unsafe extern "C" fn notify_is_mc_org_local_trampoline<
628            P: IsA<InetAddress>,
629            F: Fn(&P) + Send + Sync + 'static,
630        >(
631            this: *mut ffi::GInetAddress,
632            _param_spec: glib::ffi::gpointer,
633            f: glib::ffi::gpointer,
634        ) {
635            let f: &F = &*(f as *const F);
636            f(InetAddress::from_glib_borrow(this).unsafe_cast_ref())
637        }
638        unsafe {
639            let f: Box_<F> = Box_::new(f);
640            connect_raw(
641                self.as_ptr() as *mut _,
642                c"notify::is-mc-org-local".as_ptr() as *const _,
643                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
644                    notify_is_mc_org_local_trampoline::<Self, F> as *const (),
645                )),
646                Box_::into_raw(f),
647            )
648        }
649    }
650
651    #[doc(alias = "is-mc-site-local")]
652    fn connect_is_mc_site_local_notify<F: Fn(&Self) + Send + Sync + 'static>(
653        &self,
654        f: F,
655    ) -> SignalHandlerId {
656        unsafe extern "C" fn notify_is_mc_site_local_trampoline<
657            P: IsA<InetAddress>,
658            F: Fn(&P) + Send + Sync + 'static,
659        >(
660            this: *mut ffi::GInetAddress,
661            _param_spec: glib::ffi::gpointer,
662            f: glib::ffi::gpointer,
663        ) {
664            let f: &F = &*(f as *const F);
665            f(InetAddress::from_glib_borrow(this).unsafe_cast_ref())
666        }
667        unsafe {
668            let f: Box_<F> = Box_::new(f);
669            connect_raw(
670                self.as_ptr() as *mut _,
671                c"notify::is-mc-site-local".as_ptr() as *const _,
672                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
673                    notify_is_mc_site_local_trampoline::<Self, F> as *const (),
674                )),
675                Box_::into_raw(f),
676            )
677        }
678    }
679
680    #[doc(alias = "is-multicast")]
681    fn connect_is_multicast_notify<F: Fn(&Self) + Send + Sync + 'static>(
682        &self,
683        f: F,
684    ) -> SignalHandlerId {
685        unsafe extern "C" fn notify_is_multicast_trampoline<
686            P: IsA<InetAddress>,
687            F: Fn(&P) + Send + Sync + 'static,
688        >(
689            this: *mut ffi::GInetAddress,
690            _param_spec: glib::ffi::gpointer,
691            f: glib::ffi::gpointer,
692        ) {
693            let f: &F = &*(f as *const F);
694            f(InetAddress::from_glib_borrow(this).unsafe_cast_ref())
695        }
696        unsafe {
697            let f: Box_<F> = Box_::new(f);
698            connect_raw(
699                self.as_ptr() as *mut _,
700                c"notify::is-multicast".as_ptr() as *const _,
701                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
702                    notify_is_multicast_trampoline::<Self, F> as *const (),
703                )),
704                Box_::into_raw(f),
705            )
706        }
707    }
708
709    #[doc(alias = "is-site-local")]
710    fn connect_is_site_local_notify<F: Fn(&Self) + Send + Sync + 'static>(
711        &self,
712        f: F,
713    ) -> SignalHandlerId {
714        unsafe extern "C" fn notify_is_site_local_trampoline<
715            P: IsA<InetAddress>,
716            F: Fn(&P) + Send + Sync + 'static,
717        >(
718            this: *mut ffi::GInetAddress,
719            _param_spec: glib::ffi::gpointer,
720            f: glib::ffi::gpointer,
721        ) {
722            let f: &F = &*(f as *const F);
723            f(InetAddress::from_glib_borrow(this).unsafe_cast_ref())
724        }
725        unsafe {
726            let f: Box_<F> = Box_::new(f);
727            connect_raw(
728                self.as_ptr() as *mut _,
729                c"notify::is-site-local".as_ptr() as *const _,
730                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
731                    notify_is_site_local_trampoline::<Self, F> as *const (),
732                )),
733                Box_::into_raw(f),
734            )
735        }
736    }
737}
738
739impl<O: IsA<InetAddress>> InetAddressExt for O {}