pub type ENetCompressor = _ENetCompressor;Expand description
An ENet packet compressor for compressing UDP packets before socket sends or receives.
Aliased Type§
#[repr(C)]pub struct ENetCompressor {
pub context: *mut c_void,
pub compress: Option<unsafe extern "C" fn(*mut c_void, *const ENetBuffer, usize, usize, *mut u8, usize) -> usize>,
pub decompress: Option<unsafe extern "C" fn(*mut c_void, *const u8, usize, *mut u8, usize) -> usize>,
pub destroy: Option<unsafe extern "C" fn(*mut c_void)>,
}Fields§
§context: *mut c_voidContext data for the compressor. Must be non-NULL.
compress: Option<unsafe extern "C" fn(*mut c_void, *const ENetBuffer, usize, usize, *mut u8, usize) -> usize>Compresses from inBuffers[0:inBufferCount-1], containing inLimit bytes, to outData, outputting at most outLimit bytes. Should return 0 on failure.
decompress: Option<unsafe extern "C" fn(*mut c_void, *const u8, usize, *mut u8, usize) -> usize>Decompresses from inData, containing inLimit bytes, to outData, outputting at most outLimit bytes. Should return 0 on failure.
destroy: Option<unsafe extern "C" fn(*mut c_void)>Destroys the context when compression is disabled or the host is destroyed. May be NULL.