servicepoint-binding-csharp/servicepoint2/src/c_slice.rs
Vinzenz Schroeter 1dad113ca1 a bunch of minor changes combined:
- From instead of Into
- unsafe_data_ref for other payloads
- CByteSlice for returning memory spans
- send Packet instead of Into<Packet>
- expose packet layer to C/C#
2024-05-15 20:34:51 +02:00

12 lines
314 B
Rust

#[cfg(feature = "c-api")]
#[repr(C)]
/// Represents a span of memory (`&mut [u8]` ) as a struct usable by C code.
///
/// Usage of this type is inherently unsafe.
pub struct CByteSlice {
/// The start address of the memory
pub start: *mut u8,
/// The amount of memory in bytes
pub length: usize,
}