#[repr(C)]pub struct Whod {
pub wd_vers: u8,
pub wd_type: u8,
pub wd_pad: [u8; 2],
pub wd_sendtime: i32,
pub wd_recvtime: i32,
pub wd_hostname: [u8; 32],
pub wd_loadav: [i32; 3],
pub wd_boottime: i32,
pub wd_we: [Whoent; 42],
}Expand description
Classic C struct for a rwhod status update.
This struct is used in the rwhod protocol by being interpreted as raw bytes to be sent over UDP.
Fields§
§wd_vers: u8protocol version
wd_type: u8packet type, see below
wd_pad: [u8; 2]§wd_sendtime: i32time stamp by sender
wd_recvtime: i32time stamp applied by receiver
wd_hostname: [u8; 32]host’s name
wd_loadav: [i32; 3]load average as in uptime
wd_boottime: i32time system booted
wd_we: [Whoent; 42]Implementations§
Source§impl Whod
impl Whod
pub const HEADER_SIZE: usize
pub const MAX_SIZE: usize
pub const MAX_HOSTNAME_LEN: usize = 32
pub const MAX_WHOENTRIES: usize
pub const WHODVERSION: u8 = 1
pub const WHODTYPE_STATUS: u8 = 1
pub fn new( sendtime: i32, recvtime: i32, hostname: [u8; 32], loadav: [i32; 3], boottime: i32, whoentries: [Whoent; 42], ) -> Self
pub fn to_bytes(&self) -> Vec<u8> ⓘ
pub fn from_bytes(input: &[u8]) -> Result<Self>
Trait Implementations§
Source§impl TryFrom<Whod> for WhodStatusUpdate
impl TryFrom<Whod> for WhodStatusUpdate
Source§impl TryFrom<WhodStatusUpdate> for Whod
impl TryFrom<WhodStatusUpdate> for Whod
impl Eq for Whod
impl StructuralPartialEq for Whod
Auto Trait Implementations§
impl Freeze for Whod
impl RefUnwindSafe for Whod
impl Send for Whod
impl Sync for Whod
impl Unpin for Whod
impl UnwindSafe for Whod
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more