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