gio/
socket_control_message.rs

1// Take a look at the license at the top of the repository in the LICENSE file.
2
3use glib::{prelude::*, translate::*};
4
5use crate::{prelude::*, SocketControlMessage};
6
7mod sealed {
8    pub trait Sealed {}
9    impl<T: super::IsA<super::SocketControlMessage>> Sealed for T {}
10}
11
12pub trait SocketControlMessageExtManual:
13    sealed::Sealed + IsA<SocketControlMessage> + Sized
14{
15    #[doc(alias = "g_socket_control_message_serialize")]
16    fn serialize(&self, data: &mut [u8]) {
17        assert!(data.len() >= self.size());
18        unsafe {
19            crate::ffi::g_socket_control_message_serialize(
20                self.as_ref().to_glib_none().0,
21                data.as_mut_ptr() as *mut _,
22            );
23        }
24    }
25}
26
27impl<O: IsA<SocketControlMessage>> SocketControlMessageExtManual for O {}