use super::base::*;
#[repr(C, packed)]
#[derive(Default, Copy, Clone)]
pub struct FastIoWriteUnionStruct {
pub number_of_packets: u16,
pub write_in_progress_flag: u16,
}
#[repr(C, packed)]
#[derive(Copy, Clone)]
pub union FastIoWriteUnion {
pub split: FastIoWriteUnionStruct,
pub join: u32,
}
impl Default for FastIoWriteUnion {
fn default() -> Self {
FastIoWriteUnion { join: 0 }
}
}
#[repr(C, packed)]
#[derive(Default, Copy, Clone)]
pub struct FastIoSectionHeader {
pub fast_io_write_union: FastIoWriteUnion,
pub read_in_progress_flag: u32,
}
#[repr(C, packed)]
#[derive(Copy, Clone)]
pub struct FastIoSection<const N: usize> {
pub fast_io_header: FastIoSectionHeader,
pub fast_io_packets: [IntermediateBuffer; N],
}
impl<const N: usize> Default for FastIoSection<N> {
fn default() -> Self {
unsafe { std::mem::zeroed() }
}
}
#[repr(C, packed)]
#[derive(Debug, Copy, Clone)]
pub struct InitializeFastIoParams<const N: usize> {
pub header_ptr: *mut FastIoSection<N>,
pub data_size: u32,
}
#[repr(C, packed)]
#[derive(Copy, Clone)]
pub struct UnsortedSendRequest<'a, const N: usize> {
pub packets: Option<&'a [Option<&'a IntermediateBuffer>; N]>,
pub packets_num: u32,
}
#[repr(C, packed)]
#[derive(Copy, Clone)]
pub struct UnsortedReadRequest<'a, const N: usize> {
pub packets: Option<&'a [Option<&'a mut IntermediateBuffer>; N]>,
pub packets_num: u32,
}