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::{SocketFamily, ffi};
6use glib::{
7    prelude::*,
8    signal::{SignalHandlerId, connect_raw},
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            unsafe {
462                let f: &F = &*(f as *const F);
463                f(InetAddress::from_glib_borrow(this).unsafe_cast_ref())
464            }
465        }
466        unsafe {
467            let f: Box_<F> = Box_::new(f);
468            connect_raw(
469                self.as_ptr() as *mut _,
470                c"notify::is-any".as_ptr() as *const _,
471                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
472                    notify_is_any_trampoline::<Self, F> as *const (),
473                )),
474                Box_::into_raw(f),
475            )
476        }
477    }
478
479    #[doc(alias = "is-link-local")]
480    fn connect_is_link_local_notify<F: Fn(&Self) + Send + Sync + 'static>(
481        &self,
482        f: F,
483    ) -> SignalHandlerId {
484        unsafe extern "C" fn notify_is_link_local_trampoline<
485            P: IsA<InetAddress>,
486            F: Fn(&P) + Send + Sync + 'static,
487        >(
488            this: *mut ffi::GInetAddress,
489            _param_spec: glib::ffi::gpointer,
490            f: glib::ffi::gpointer,
491        ) {
492            unsafe {
493                let f: &F = &*(f as *const F);
494                f(InetAddress::from_glib_borrow(this).unsafe_cast_ref())
495            }
496        }
497        unsafe {
498            let f: Box_<F> = Box_::new(f);
499            connect_raw(
500                self.as_ptr() as *mut _,
501                c"notify::is-link-local".as_ptr() as *const _,
502                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
503                    notify_is_link_local_trampoline::<Self, F> as *const (),
504                )),
505                Box_::into_raw(f),
506            )
507        }
508    }
509
510    #[doc(alias = "is-loopback")]
511    fn connect_is_loopback_notify<F: Fn(&Self) + Send + Sync + 'static>(
512        &self,
513        f: F,
514    ) -> SignalHandlerId {
515        unsafe extern "C" fn notify_is_loopback_trampoline<
516            P: IsA<InetAddress>,
517            F: Fn(&P) + Send + Sync + 'static,
518        >(
519            this: *mut ffi::GInetAddress,
520            _param_spec: glib::ffi::gpointer,
521            f: glib::ffi::gpointer,
522        ) {
523            unsafe {
524                let f: &F = &*(f as *const F);
525                f(InetAddress::from_glib_borrow(this).unsafe_cast_ref())
526            }
527        }
528        unsafe {
529            let f: Box_<F> = Box_::new(f);
530            connect_raw(
531                self.as_ptr() as *mut _,
532                c"notify::is-loopback".as_ptr() as *const _,
533                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
534                    notify_is_loopback_trampoline::<Self, F> as *const (),
535                )),
536                Box_::into_raw(f),
537            )
538        }
539    }
540
541    #[doc(alias = "is-mc-global")]
542    fn connect_is_mc_global_notify<F: Fn(&Self) + Send + Sync + 'static>(
543        &self,
544        f: F,
545    ) -> SignalHandlerId {
546        unsafe extern "C" fn notify_is_mc_global_trampoline<
547            P: IsA<InetAddress>,
548            F: Fn(&P) + Send + Sync + 'static,
549        >(
550            this: *mut ffi::GInetAddress,
551            _param_spec: glib::ffi::gpointer,
552            f: glib::ffi::gpointer,
553        ) {
554            unsafe {
555                let f: &F = &*(f as *const F);
556                f(InetAddress::from_glib_borrow(this).unsafe_cast_ref())
557            }
558        }
559        unsafe {
560            let f: Box_<F> = Box_::new(f);
561            connect_raw(
562                self.as_ptr() as *mut _,
563                c"notify::is-mc-global".as_ptr() as *const _,
564                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
565                    notify_is_mc_global_trampoline::<Self, F> as *const (),
566                )),
567                Box_::into_raw(f),
568            )
569        }
570    }
571
572    #[doc(alias = "is-mc-link-local")]
573    fn connect_is_mc_link_local_notify<F: Fn(&Self) + Send + Sync + 'static>(
574        &self,
575        f: F,
576    ) -> SignalHandlerId {
577        unsafe extern "C" fn notify_is_mc_link_local_trampoline<
578            P: IsA<InetAddress>,
579            F: Fn(&P) + Send + Sync + 'static,
580        >(
581            this: *mut ffi::GInetAddress,
582            _param_spec: glib::ffi::gpointer,
583            f: glib::ffi::gpointer,
584        ) {
585            unsafe {
586                let f: &F = &*(f as *const F);
587                f(InetAddress::from_glib_borrow(this).unsafe_cast_ref())
588            }
589        }
590        unsafe {
591            let f: Box_<F> = Box_::new(f);
592            connect_raw(
593                self.as_ptr() as *mut _,
594                c"notify::is-mc-link-local".as_ptr() as *const _,
595                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
596                    notify_is_mc_link_local_trampoline::<Self, F> as *const (),
597                )),
598                Box_::into_raw(f),
599            )
600        }
601    }
602
603    #[doc(alias = "is-mc-node-local")]
604    fn connect_is_mc_node_local_notify<F: Fn(&Self) + Send + Sync + 'static>(
605        &self,
606        f: F,
607    ) -> SignalHandlerId {
608        unsafe extern "C" fn notify_is_mc_node_local_trampoline<
609            P: IsA<InetAddress>,
610            F: Fn(&P) + Send + Sync + 'static,
611        >(
612            this: *mut ffi::GInetAddress,
613            _param_spec: glib::ffi::gpointer,
614            f: glib::ffi::gpointer,
615        ) {
616            unsafe {
617                let f: &F = &*(f as *const F);
618                f(InetAddress::from_glib_borrow(this).unsafe_cast_ref())
619            }
620        }
621        unsafe {
622            let f: Box_<F> = Box_::new(f);
623            connect_raw(
624                self.as_ptr() as *mut _,
625                c"notify::is-mc-node-local".as_ptr() as *const _,
626                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
627                    notify_is_mc_node_local_trampoline::<Self, F> as *const (),
628                )),
629                Box_::into_raw(f),
630            )
631        }
632    }
633
634    #[doc(alias = "is-mc-org-local")]
635    fn connect_is_mc_org_local_notify<F: Fn(&Self) + Send + Sync + 'static>(
636        &self,
637        f: F,
638    ) -> SignalHandlerId {
639        unsafe extern "C" fn notify_is_mc_org_local_trampoline<
640            P: IsA<InetAddress>,
641            F: Fn(&P) + Send + Sync + 'static,
642        >(
643            this: *mut ffi::GInetAddress,
644            _param_spec: glib::ffi::gpointer,
645            f: glib::ffi::gpointer,
646        ) {
647            unsafe {
648                let f: &F = &*(f as *const F);
649                f(InetAddress::from_glib_borrow(this).unsafe_cast_ref())
650            }
651        }
652        unsafe {
653            let f: Box_<F> = Box_::new(f);
654            connect_raw(
655                self.as_ptr() as *mut _,
656                c"notify::is-mc-org-local".as_ptr() as *const _,
657                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
658                    notify_is_mc_org_local_trampoline::<Self, F> as *const (),
659                )),
660                Box_::into_raw(f),
661            )
662        }
663    }
664
665    #[doc(alias = "is-mc-site-local")]
666    fn connect_is_mc_site_local_notify<F: Fn(&Self) + Send + Sync + 'static>(
667        &self,
668        f: F,
669    ) -> SignalHandlerId {
670        unsafe extern "C" fn notify_is_mc_site_local_trampoline<
671            P: IsA<InetAddress>,
672            F: Fn(&P) + Send + Sync + 'static,
673        >(
674            this: *mut ffi::GInetAddress,
675            _param_spec: glib::ffi::gpointer,
676            f: glib::ffi::gpointer,
677        ) {
678            unsafe {
679                let f: &F = &*(f as *const F);
680                f(InetAddress::from_glib_borrow(this).unsafe_cast_ref())
681            }
682        }
683        unsafe {
684            let f: Box_<F> = Box_::new(f);
685            connect_raw(
686                self.as_ptr() as *mut _,
687                c"notify::is-mc-site-local".as_ptr() as *const _,
688                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
689                    notify_is_mc_site_local_trampoline::<Self, F> as *const (),
690                )),
691                Box_::into_raw(f),
692            )
693        }
694    }
695
696    #[doc(alias = "is-multicast")]
697    fn connect_is_multicast_notify<F: Fn(&Self) + Send + Sync + 'static>(
698        &self,
699        f: F,
700    ) -> SignalHandlerId {
701        unsafe extern "C" fn notify_is_multicast_trampoline<
702            P: IsA<InetAddress>,
703            F: Fn(&P) + Send + Sync + 'static,
704        >(
705            this: *mut ffi::GInetAddress,
706            _param_spec: glib::ffi::gpointer,
707            f: glib::ffi::gpointer,
708        ) {
709            unsafe {
710                let f: &F = &*(f as *const F);
711                f(InetAddress::from_glib_borrow(this).unsafe_cast_ref())
712            }
713        }
714        unsafe {
715            let f: Box_<F> = Box_::new(f);
716            connect_raw(
717                self.as_ptr() as *mut _,
718                c"notify::is-multicast".as_ptr() as *const _,
719                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
720                    notify_is_multicast_trampoline::<Self, F> as *const (),
721                )),
722                Box_::into_raw(f),
723            )
724        }
725    }
726
727    #[doc(alias = "is-site-local")]
728    fn connect_is_site_local_notify<F: Fn(&Self) + Send + Sync + 'static>(
729        &self,
730        f: F,
731    ) -> SignalHandlerId {
732        unsafe extern "C" fn notify_is_site_local_trampoline<
733            P: IsA<InetAddress>,
734            F: Fn(&P) + Send + Sync + 'static,
735        >(
736            this: *mut ffi::GInetAddress,
737            _param_spec: glib::ffi::gpointer,
738            f: glib::ffi::gpointer,
739        ) {
740            unsafe {
741                let f: &F = &*(f as *const F);
742                f(InetAddress::from_glib_borrow(this).unsafe_cast_ref())
743            }
744        }
745        unsafe {
746            let f: Box_<F> = Box_::new(f);
747            connect_raw(
748                self.as_ptr() as *mut _,
749                c"notify::is-site-local".as_ptr() as *const _,
750                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
751                    notify_is_site_local_trampoline::<Self, F> as *const (),
752                )),
753                Box_::into_raw(f),
754            )
755        }
756    }
757}
758
759impl<O: IsA<InetAddress>> InetAddressExt for O {}