wslplugins-rs 0.1.0-beta.2

A Rust framework for developing WSL plugins using safe and idiomatic Rust.
Documentation
use std::fmt::{self, Debug, Display};

#[derive(Clone, Copy, PartialEq, Eq, Hash)]
pub struct SessionID(pub u32);

impl From<u32> for SessionID {
    #[inline]
    fn from(value: u32) -> Self {
        Self(value)
    }
}

impl From<SessionID> for u32 {
    #[inline]
    fn from(value: SessionID) -> Self {
        value.0
    }
}

impl Debug for SessionID {
    #[inline]
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        Debug::fmt(&self.0, f)
    }
}

impl Display for SessionID {
    #[inline]
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        Display::fmt(&self.0, f)
    }
}