use crate::specifiers::{DuplexStatus, LinkStatus, OperationMode, Protocol, SpeedStatus};
macro_rules! impl_boilerplate_for {
($REG:ident) => {
impl From<u8> for $REG {
fn from(val: u8) -> Self {
Self(val)
}
}
impl From<$REG> for u8 {
fn from(val: $REG) -> u8 {
val.0
}
}
impl Default for $REG {
fn default() -> Self {
Self::DEFAULT
}
}
};
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub struct Mode(u8);
impl_boilerplate_for!(Mode);
impl Mode {
pub const RESET: u8 = 0x00;
pub const DEFAULT: Self = Self(Self::RESET);
pub const RST_OFFSET: u8 = 7;
pub const WOL_OFFSET: u8 = 5;
pub const PB_OFFSET: u8 = 4;
pub const PPPOE_OFFSET: u8 = 3;
pub const FARP_OFFSET: u8 = 1;
pub const RST_MASK: u8 = 1 << Self::RST_OFFSET;
pub const WOL_MASK: u8 = 1 << Self::WOL_OFFSET;
pub const PB_MASK: u8 = 1 << Self::PB_OFFSET;
pub const PPPOE_MASK: u8 = 1 << Self::PPPOE_OFFSET;
pub const FARP_MASK: u8 = 1 << Self::FARP_OFFSET;
#[must_use = "rst returns a modified Mode"]
pub const fn rst(mut self) -> Self {
self.0 |= Self::RST_MASK;
self
}
pub const fn wol_enabled(&self) -> bool {
self.0 & Self::WOL_MASK != 0
}
#[must_use = "enable_wol returns a modified Mode"]
pub const fn enable_wol(mut self) -> Self {
self.0 |= Self::WOL_MASK;
self
}
#[must_use = "disable_wol returns a modified Mode"]
pub const fn disable_wol(mut self) -> Self {
self.0 &= !Self::WOL_MASK;
self
}
pub const fn pb_enabled(&self) -> bool {
self.0 & Self::PB_MASK != 0
}
#[must_use = "enable_pb returns a modified Mode"]
pub const fn enable_pb(mut self) -> Self {
self.0 |= Self::PB_MASK;
self
}
#[must_use = "disable_pb returns a modified Mode"]
pub const fn disable_pb(mut self) -> Self {
self.0 &= !Self::PB_MASK;
self
}
pub const fn pppoe_enabled(&self) -> bool {
self.0 & Self::PPPOE_MASK != 0
}
#[must_use = "enable_pppoe returns a modified Mode"]
pub const fn enable_pppoe(mut self) -> Self {
self.0 |= Self::PPPOE_MASK;
self
}
#[must_use = "disable_pppoe returns a modified Mode"]
pub const fn disable_pppoe(mut self) -> Self {
self.0 &= !Self::PPPOE_MASK;
self
}
pub const fn farp_enabled(&self) -> bool {
self.0 & Self::FARP_MASK != 0
}
#[must_use = "enable_farp returns a modified Mode"]
pub const fn enable_farp(mut self) -> Self {
self.0 |= Self::FARP_MASK;
self
}
#[must_use = "disable_farp returns a modified Mode"]
pub const fn disable_farp(mut self) -> Self {
self.0 &= !Self::FARP_MASK;
self
}
}
impl ::core::fmt::Display for Mode {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Mode")
.field("wol_enabled", &self.wol_enabled())
.field("pb_enabled", &self.pb_enabled())
.field("pppoe_enabled", &self.pppoe_enabled())
.field("farp_enabled", &self.farp_enabled())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Mode {
fn format(&self, fmt: defmt::Formatter) {
defmt::write!(
fmt,
"Mode {{ wol_enabled: {}, pb_enabled: {}, pppoe_enabled: {}, farp_enabled: {} }}",
self.wol_enabled(),
self.pb_enabled(),
self.pppoe_enabled(),
self.farp_enabled(),
);
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
pub struct Interrupt(u8);
impl_boilerplate_for!(Interrupt);
impl Interrupt {
pub const RESET: u8 = 0x00;
pub const DEFAULT: Self = Self(Self::RESET);
pub const CONFLICT_OFFSET: u8 = 7;
pub const UNREACH_OFFSET: u8 = 6;
pub const PPPOE_OFFSET: u8 = 5;
pub const MP_OFFSET: u8 = 4;
pub const CONFLICT_MASK: u8 = 1 << Self::CONFLICT_OFFSET;
pub const UNREACH_MASK: u8 = 1 << Self::UNREACH_OFFSET;
pub const PPPOE_MASK: u8 = 1 << Self::PPPOE_OFFSET;
pub const MP_MASK: u8 = 1 << Self::MP_OFFSET;
pub const fn conflict(&self) -> bool {
self.0 & Self::CONFLICT_MASK != 0
}
#[must_use = "set_conflict returns a modified Interrupt"]
pub const fn set_conflict(mut self) -> Self {
self.0 |= Self::CONFLICT_MASK;
self
}
#[must_use = "clear_conflict returns a modified Interrupt"]
pub const fn clear_conflict(mut self) -> Self {
self.0 &= !Self::CONFLICT_MASK;
self
}
pub const fn unreach(&self) -> bool {
self.0 & Self::UNREACH_MASK != 0
}
#[must_use = "set_unreach returns a modified Interrupt"]
pub const fn set_unreach(mut self) -> Self {
self.0 |= Self::UNREACH_MASK;
self
}
#[must_use = "clear_unreach returns a modified Interrupt"]
pub const fn clear_unreach(mut self) -> Self {
self.0 &= !Self::UNREACH_MASK;
self
}
pub const fn pppoe(&self) -> bool {
self.0 & Self::PPPOE_MASK != 0
}
#[must_use = "set_pppoe returns a modified Interrupt"]
pub const fn set_pppoe(mut self) -> Self {
self.0 |= Self::PPPOE_MASK;
self
}
#[must_use = "clear_pppoe returns a modified Interrupt"]
pub const fn clear_pppoe(mut self) -> Self {
self.0 &= !Self::PPPOE_MASK;
self
}
pub const fn mp(&self) -> bool {
self.0 & Self::MP_MASK != 0
}
#[must_use = "set_mp returns a modified Interrupt"]
pub const fn set_mp(mut self) -> Self {
self.0 |= Self::MP_MASK;
self
}
#[must_use = "clear_mp returns a modified Interrupt"]
pub const fn clear_mp(mut self) -> Self {
self.0 &= !Self::MP_MASK;
self
}
}
impl ::core::fmt::Display for Interrupt {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Interrupt")
.field("conflict", &self.conflict())
.field("unreach", &self.unreach())
.field("pppoe", &self.pppoe())
.field("mp", &self.mp())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Interrupt {
fn format(&self, fmt: defmt::Formatter) {
defmt::write!(
fmt,
"Interrupt {{ conflict: {}, unreach: {}, pppoe: {}, mp: {} }}",
self.conflict(),
self.unreach(),
self.pppoe(),
self.mp(),
);
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
pub struct PhyCfg(u8);
impl_boilerplate_for!(PhyCfg);
impl PhyCfg {
pub const RESET: u8 = 0b10111000;
pub const DEFAULT: Self = Self(Self::RESET);
pub const RST_OFFSET: u8 = 7;
pub const OPMD_OFFSET: u8 = 6;
pub const OPMDC_OFFSET: u8 = 3;
pub const DPX_OFFSET: u8 = 2;
pub const SPD_OFFSET: u8 = 1;
pub const LNK_OFFSET: u8 = 0;
pub const RST_MASK: u8 = 1 << Self::RST_OFFSET;
pub const OPMD_MASK: u8 = 1 << Self::OPMD_OFFSET;
pub const OPMDC_MASK: u8 = 0b111 << Self::OPMDC_OFFSET;
pub const DPX_MASK: u8 = 1 << Self::DPX_OFFSET;
pub const SPD_MASK: u8 = 1 << Self::SPD_OFFSET;
pub const LNK_MASK: u8 = 1 << Self::LNK_OFFSET;
#[must_use = "rst returns a modified PhyCfg"]
pub const fn rst(mut self) -> Self {
self.0 &= !Self::RST_MASK;
self
}
pub const fn opmd(&self) -> bool {
self.0 & Self::OPMD_MASK != 0
}
#[must_use = "hardware_op returns a modified PhyCfg"]
pub const fn hardware_op(mut self) -> Self {
self.0 &= !Self::OPMD_MASK;
self
}
#[must_use = "software_op returns a modified PhyCfg"]
pub const fn software_op(mut self) -> Self {
self.0 |= Self::OPMD_MASK;
self
}
pub const fn opmdc(&self) -> OperationMode {
OperationMode::from_raw(self.0 >> Self::OPMDC_OFFSET)
}
#[must_use = "set_opmdc returns a modified PhyCfg"]
pub const fn set_opmdc(mut self, mode: OperationMode) -> Self {
self = self.software_op();
self.0 &= !Self::OPMDC_MASK;
self.0 |= (mode as u8) << Self::OPMDC_OFFSET;
self
}
pub const fn dpx(&self) -> DuplexStatus {
match self.0 & Self::DPX_MASK == Self::DPX_MASK {
true => DuplexStatus::Full,
false => DuplexStatus::Half,
}
}
pub const fn spd(&self) -> SpeedStatus {
match self.0 & Self::SPD_MASK == Self::SPD_MASK {
true => SpeedStatus::Mbps100,
false => SpeedStatus::Mbps10,
}
}
pub const fn lnk(&self) -> LinkStatus {
match self.0 & Self::LNK_MASK == Self::LNK_MASK {
true => LinkStatus::Up,
false => LinkStatus::Down,
}
}
}
impl ::core::fmt::Display for PhyCfg {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("PhyCfg")
.field("opmd", &self.opmd())
.field("opmdc", &self.opmdc())
.field("dpx", &self.dpx())
.field("spd", &self.spd())
.field("lnk", &self.lnk())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for PhyCfg {
fn format(&self, fmt: defmt::Formatter) {
defmt::write!(
fmt,
"PhyCfg {{ opmd: {}, opmdc: {}, dpx: {}, spd: {}, lnk: {} }}",
self.opmd(),
self.opmdc(),
self.dpx(),
self.spd(),
self.lnk(),
);
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
pub struct SocketMode(u8);
impl_boilerplate_for!(SocketMode);
impl SocketMode {
pub const RESET: u8 = 0x00;
pub const DEFAULT: Self = Self(Self::RESET);
pub const MULTI_OFFSET: u8 = 7;
pub const MFEN_OFFSET: u8 = 7;
pub const BCASTB_OFFSET: u8 = 6;
pub const ND_OFFSET: u8 = 5;
pub const MC_OFFSET: u8 = 5;
pub const MMB_OFFSET: u8 = 5;
pub const UCASTB_OFFSET: u8 = 4;
pub const MIP6B_OFFSET: u8 = 4;
pub const MULTI_MASK: u8 = 1 << Self::MULTI_OFFSET;
pub const MFEN_MASK: u8 = 1 << Self::MFEN_OFFSET;
pub const BCASTB_MASK: u8 = 1 << Self::BCASTB_OFFSET;
pub const ND_MASK: u8 = 1 << Self::ND_OFFSET;
pub const MC_MASK: u8 = 1 << Self::MC_OFFSET;
pub const MMB_MASK: u8 = 1 << Self::MMB_OFFSET;
pub const UCASTB_MASK: u8 = 1 << Self::UCASTB_OFFSET;
pub const MIP6B_MASK: u8 = 1 << Self::MIP6B_OFFSET;
pub const PROTOCOL_MASK: u8 = 0xF;
pub const fn protocol(&self) -> Result<Protocol, u8> {
Protocol::from_raw(self.0 & Self::PROTOCOL_MASK)
}
pub const fn set_protocol(mut self, protocol: Protocol) -> Self {
self.0 = (self.0 & 0xF0) | ((protocol as u8) & 0xF);
self
}
pub const fn multi_enabled(&self) -> bool {
self.0 & Self::MULTI_MASK != 0
}
#[must_use = "enable_multi returns a modified SocketMode"]
pub const fn enable_multi(mut self) -> Self {
self.0 |= Self::MULTI_MASK;
self
}
#[must_use = "disable_multi returns a modified SocketMode"]
pub const fn disable_multi(mut self) -> Self {
self.0 &= !Self::MULTI_MASK;
self
}
pub const fn mfen_enabled(&self) -> bool {
self.0 & Self::MFEN_MASK != 0
}
#[must_use = "enable_mfen returns a modified SocketMode"]
pub const fn enable_mfen(mut self) -> Self {
self.0 |= Self::MFEN_MASK;
self
}
#[must_use = "disable_mfen returns a modified SocketMode"]
pub const fn disable_mfen(mut self) -> Self {
self.0 &= !Self::MFEN_MASK;
self
}
pub const fn bcastb_enabled(&self) -> bool {
self.0 & Self::BCASTB_MASK != 0
}
#[must_use = "enable_bcastb returns a modified SocketMode"]
pub const fn enable_bcastb(mut self) -> Self {
self.0 |= Self::BCASTB_MASK;
self
}
#[must_use = "disable_bcastb returns a modified SocketMode"]
pub const fn disable_bcastb(mut self) -> Self {
self.0 &= !Self::BCASTB_MASK;
self
}
pub const fn nd_enabled(&self) -> bool {
self.0 & Self::ND_MASK != 0
}
#[must_use = "disable_nd returns a modified SocketMode"]
pub const fn disable_nd(mut self) -> Self {
self.0 &= !Self::ND_MASK;
self
}
#[must_use = "enable_nd returns a modified SocketMode"]
pub const fn enable_nd(mut self) -> Self {
self.0 |= Self::ND_MASK;
self
}
pub const fn mc(&self) -> bool {
self.0 & Self::MC_MASK != 0
}
#[must_use = "set_igmp_v1 returns a modified SocketMode"]
pub const fn set_igmp_v1(mut self) -> Self {
self.0 |= Self::MC_MASK;
self
}
#[must_use = "set_igmp_v2 returns a modified SocketMode"]
pub const fn set_igmp_v2(mut self) -> Self {
self.0 &= !Self::MC_MASK;
self
}
pub const fn mmb_enabled(&self) -> bool {
self.0 & Self::MMB_MASK != 0
}
#[must_use = "enable_mmb returns a modified SocketMode"]
pub const fn enable_mmb(mut self) -> Self {
self.0 |= Self::MMB_MASK;
self
}
#[must_use = "disable_mmb returns a modified SocketMode"]
pub const fn disable_mmb(mut self) -> Self {
self.0 &= !Self::MMB_MASK;
self
}
pub const fn ucastb_enabled(&self) -> bool {
self.0 & Self::UCASTB_MASK != 0
}
#[must_use = "enable_ucastb returns a modified SocketMode"]
pub const fn enable_ucastb(mut self) -> Self {
self.0 |= Self::UCASTB_MASK;
self
}
#[must_use = "disable_ucastb returns a modified SocketMode"]
pub const fn disable_ucastb(mut self) -> Self {
self.0 &= !Self::UCASTB_MASK;
self
}
pub const fn mip6b_enabled(&self) -> bool {
self.0 & Self::MIP6B_MASK != 0
}
#[must_use = "enable_mip6b returns a modified SocketMode"]
pub const fn enable_mip6b(mut self) -> Self {
self.0 |= Self::MIP6B_MASK;
self
}
#[must_use = "disable_mip6b returns a modified SocketMode"]
pub const fn disable_mip6b(mut self) -> Self {
self.0 &= !Self::MIP6B_MASK;
self
}
}
impl ::core::fmt::Display for SocketMode {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("SocketMode")
.field("protocol", &self.protocol())
.field("multi_enabled", &self.multi_enabled())
.field("mfen_enabled", &self.mfen_enabled())
.field("bcastb_enabled", &self.bcastb_enabled())
.field("nd_enabled", &self.nd_enabled())
.field("mc", &self.mc())
.field("mmb_enabled", &self.mmb_enabled())
.field("ucastb_enabled", &self.ucastb_enabled())
.field("mip6b_enabled", &self.mip6b_enabled())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for SocketMode {
fn format(&self, fmt: defmt::Formatter) {
defmt::write!(
fmt,
"SocketMode {{ protocol: {}, multi_enabled: {}, mfen_enabled: {}, bcastb_enabled: {}, nd_enabled: {}, mc: {}, mmb_enabled: {}, ucastb_enabled: {}, mip6b_enabled: {} }}",
self.protocol(),
self.multi_enabled(),
self.mfen_enabled(),
self.bcastb_enabled(),
self.nd_enabled(),
self.mc(),
self.mmb_enabled(),
self.ucastb_enabled(),
self.mip6b_enabled(),
);
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
pub struct SocketInterrupt(u8);
impl_boilerplate_for!(SocketInterrupt);
impl SocketInterrupt {
pub const RESET: u8 = 0x00;
pub const DEFAULT: Self = Self(Self::RESET);
pub const CON_OFFSET: u8 = 0;
pub const DISCON_OFFSET: u8 = 1;
pub const RECV_OFFSET: u8 = 2;
pub const TIMEOUT_OFFSET: u8 = 3;
pub const SENDOK_OFFSET: u8 = 4;
pub const CON_MASK: u8 = 1 << Self::CON_OFFSET;
pub const DISCON_MASK: u8 = 1 << Self::DISCON_OFFSET;
pub const RECV_MASK: u8 = 1 << Self::RECV_OFFSET;
pub const TIMEOUT_MASK: u8 = 1 << Self::TIMEOUT_OFFSET;
pub const SENDOK_MASK: u8 = 1 << Self::SENDOK_OFFSET;
const ALL_MASK: u8 = Self::CON_MASK
| Self::DISCON_MASK
| Self::RECV_MASK
| Self::TIMEOUT_MASK
| Self::SENDOK_MASK;
pub const fn con_raised(&self) -> bool {
self.0 & Self::CON_MASK != 0
}
#[must_use = "clear_con returns a modified SocketInterrupt"]
pub const fn clear_con(mut self) -> Self {
self.0 |= Self::CON_MASK;
self
}
pub const fn discon_raised(&self) -> bool {
self.0 & Self::DISCON_MASK != 0
}
#[must_use = "clear_discon returns a modified SocketInterrupt"]
pub const fn clear_discon(mut self) -> Self {
self.0 |= Self::DISCON_MASK;
self
}
pub const fn recv_raised(&self) -> bool {
self.0 & Self::RECV_MASK != 0
}
#[must_use = "clear_recv returns a modified SocketInterrupt"]
pub const fn clear_recv(mut self) -> Self {
self.0 |= Self::RECV_MASK;
self
}
pub const fn timeout_raised(&self) -> bool {
self.0 & Self::TIMEOUT_MASK != 0
}
#[must_use = "clear_timeout returns a modified SocketInterrupt"]
pub const fn clear_timeout(mut self) -> Self {
self.0 |= Self::TIMEOUT_MASK;
self
}
pub const fn sendok_raised(&self) -> bool {
self.0 & Self::SENDOK_MASK != 0
}
#[must_use = "clear_sendok returns a modified SocketInterrupt"]
pub const fn clear_sendok(mut self) -> Self {
self.0 |= Self::SENDOK_MASK;
self
}
pub const fn any_raised(&self) -> bool {
self.0 & Self::ALL_MASK != 0
}
}
impl ::core::fmt::Display for SocketInterrupt {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("SocketInterrupt")
.field("con_raised", &self.con_raised())
.field("discon_raised", &self.discon_raised())
.field("recv_raised", &self.recv_raised())
.field("timeout_raised", &self.timeout_raised())
.field("sendok_raised", &self.sendok_raised())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for SocketInterrupt {
fn format(&self, fmt: defmt::Formatter) {
defmt::write!(
fmt,
"SocketInterrupt {{ con_raised: {}, discon_raised: {}, recv_raised: {}, timeout_raised: {}, sendok_raised: {} }}",
self.con_raised(),
self.discon_raised(),
self.recv_raised(),
self.timeout_raised(),
self.sendok_raised(),
);
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
pub struct SocketInterruptMask(u8);
impl_boilerplate_for!(SocketInterruptMask);
impl SocketInterruptMask {
pub const RESET: u8 = 0xFF;
pub const DEFAULT: Self = Self(Self::RESET);
pub const ALL_MASKED: SocketInterruptMask = SocketInterruptMask(0xE0);
pub const fn con_masked(&self) -> bool {
self.0 & SocketInterrupt::CON_MASK == 0
}
#[must_use = "unmask_con returns a modified SocketInterruptMask"]
pub const fn unmask_con(mut self) -> Self {
self.0 |= SocketInterrupt::CON_MASK;
self
}
#[must_use = "mask_con returns a modified SocketInterruptMask"]
pub const fn mask_con(mut self) -> Self {
self.0 &= !SocketInterrupt::CON_MASK;
self
}
pub const fn discon_masked(&self) -> bool {
self.0 & SocketInterrupt::DISCON_MASK == 0
}
#[must_use = "unmask_discon returns a modified SocketInterruptMask"]
pub const fn unmask_discon(mut self) -> Self {
self.0 |= SocketInterrupt::DISCON_MASK;
self
}
#[must_use = "mask_discon returns a modified SocketInterruptMask"]
pub const fn mask_discon(mut self) -> Self {
self.0 &= !SocketInterrupt::DISCON_MASK;
self
}
pub const fn recv_masked(&self) -> bool {
self.0 & SocketInterrupt::RECV_MASK == 0
}
#[must_use = "unmask_recv returns a modified SocketInterruptMask"]
pub const fn unmask_recv(mut self) -> Self {
self.0 |= SocketInterrupt::RECV_MASK;
self
}
#[must_use = "mask_recv returns a modified SocketInterruptMask"]
pub const fn mask_recv(mut self) -> Self {
self.0 &= !SocketInterrupt::RECV_MASK;
self
}
pub const fn timeout_masked(&self) -> bool {
self.0 & SocketInterrupt::TIMEOUT_MASK == 0
}
#[must_use = "unmask_timeout returns a modified SocketInterruptMask"]
pub const fn unmask_timeout(mut self) -> Self {
self.0 |= SocketInterrupt::TIMEOUT_MASK;
self
}
#[must_use = "mask_timeout returns a modified SocketInterruptMask"]
pub const fn mask_timeout(mut self) -> Self {
self.0 &= !SocketInterrupt::TIMEOUT_MASK;
self
}
pub const fn sendok_masked(&self) -> bool {
self.0 & SocketInterrupt::SENDOK_MASK == 0
}
#[must_use = "unmask_sendok returns a modified SocketInterruptMask"]
pub const fn unmask_sendok(mut self) -> Self {
self.0 |= SocketInterrupt::SENDOK_MASK;
self
}
#[must_use = "mask_sendok returns a modified SocketInterruptMask"]
pub const fn mask_sendok(mut self) -> Self {
self.0 &= !SocketInterrupt::SENDOK_MASK;
self
}
}
impl ::core::fmt::Display for SocketInterruptMask {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("SocketInterruptMask")
.field("con_masked", &self.con_masked())
.field("discon_masked", &self.discon_masked())
.field("recv_masked", &self.recv_masked())
.field("timeout_masked", &self.timeout_masked())
.field("sendok_masked", &self.sendok_masked())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for SocketInterruptMask {
fn format(&self, fmt: defmt::Formatter) {
defmt::write!(
fmt,
"SocketInterruptMask {{ con_masked: {}, discon_masked: {}, recv_masked: {}, timeout_masked: {}, sendok_masked: {} }}",
self.con_masked(),
self.discon_masked(),
self.recv_masked(),
self.timeout_masked(),
self.sendok_masked(),
);
}
}