pub const MAX_WORKERS: usize = 64;
pub(crate) const VERSION: u64 = 1;
pub(crate) const LOGON_SUCCESS: u8 = 0x01;
pub(crate) const LOGON_FAILURE: u8 = 0x02;
pub(crate) const MAX_ALLOCATOR_HANDLES: usize = 128;
pub(crate) const GLOBAL_ALLOCATORS: usize = 1;
#[derive(Debug, Default, Clone, Copy)]
#[repr(C)]
pub struct ClientLogon {
pub worker_count: usize,
pub allocator_size: usize,
pub allocator_handles: usize,
pub tpu_to_pack_size: usize,
pub progress_tracker_size: usize,
pub pack_to_worker_size: usize,
pub worker_to_pack_size: usize,
}
impl ClientLogon {
pub fn try_from_bytes(buffer: &[u8]) -> Option<Self> {
if buffer.len() != core::mem::size_of::<Self>() {
return None;
}
Some(unsafe { core::ptr::read_unaligned(buffer.as_ptr().cast()) })
}
}