Type Alias enet_sys::ENetCompressor
source · pub type ENetCompressor = _ENetCompressor;
Expand description
An ENet packet compressor for compressing UDP packets before socket sends or receives.
Aliased Type§
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_void
Context 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.
Trait Implementations§
source§impl Clone for _ENetCompressor
impl Clone for _ENetCompressor
source§fn clone(&self) -> _ENetCompressor
fn clone(&self) -> _ENetCompressor
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more