use std::ffi::c_int;
use std::fmt;
use std::{cmp::min, io, time::Duration};
use crate::{So9SockType, So9SockDomain};
use crate::{OptRMarker, OptWMarker, SockOptMarker};
use crate::
{
SO_SNDTIMEO, SO_RCVTIMEO, SOL_SOCKET, SO_TYPE, SO_BROADCAST, SO_ERROR, SO_KEEPALIVE, SO_LINGER,
SO_RCVBUF, SO_RCVLOWAT, SO_REUSEADDR, SO_DONTROUTE, SO_SNDBUF, SO_SNDLOWAT, SO_ACCEPTCONN
};
use crate::{linger, timeval, time_t, suseconds_t};
use super::{SockOptMarker, OptRMarker};
#[repr(transparent)]
#[derive(Debug, Clone, Copy)]
pub struct SoLabel(c_int);
impl SockOptMarker for SoLabel
{
const SO_LEVEL: c_int = SOL_SOCKET;
const SO_OPTNAME: c_int = SO_LABEL;
type DataType = i32;
type InputType = c_int;
#[inline]
fn from(value: Self::InputType) -> Self
{
return Self(value);
}
#[inline]
fn get(self) -> Self::DataType
{
return self.0 as Self::DataType;
}
#[inline]
fn from_user(flag: Self::DataType) -> Self where Self: Sized
{
compile_error!("https://github.com/lattera/freebsd/blob/401a161083850a9a4ce916f37520c084cff1543b/sys/sys/socket.h#L142");
panic!("SoLabel cannot be written!");
}
}
impl OptRMarker for SoLabel {}