generic wrap
Some checks failed
Rust / build-gnu-apt (pull_request) Successful in 2m4s
Rust / build-size-gnu-unstable (pull_request) Failing after 2m44s

This commit is contained in:
Vinzenz Schroeter 2025-06-26 22:23:53 +02:00
parent 5beea6151a
commit c65b735f57
16 changed files with 828 additions and 795 deletions

View file

@ -1,20 +1,19 @@
use crate::{
commands::{wrap_command, wrap_origin_accessors},
macros::{wrap, wrap_functions},
macros::wrap,
};
use servicepoint::{Bitmap, BitmapCommand, CompressionCode, Origin};
use std::ptr::NonNull;
wrap_command!(Bitmap);
wrap!(BitmapCommand;
prop bitmap: Bitmap { get mut; set move; };
prop compression: CompressionCode { get; set; };
);
wrap_origin_accessors!(BitmapCommand);
wrap_functions!(associate BitmapCommand;
wrap! {
BitmapCommand {
properties:
prop bitmap: Bitmap { get mut; set move; };
prop compression: CompressionCode { get; set; };
functions:
/// Sets a window of pixels to the specified values.
///
/// The passed [Bitmap] gets consumed.
@ -40,4 +39,5 @@ wrap_functions!(associate BitmapCommand;
fn from_bitmap(bitmap: move NonNull<Bitmap>) -> move NonNull<BitmapCommand> {
bitmap.into()
};
);
}
}

View file

@ -1,7 +1,4 @@
use crate::{
commands::wrap_command,
macros::{wrap, wrap_functions},
};
use crate::{commands::wrap_command, macros::wrap};
use servicepoint::{
BinaryOperation, BitVecCommand, CompressionCode, DisplayBitVec, Offset,
};
@ -9,14 +6,14 @@ use std::ptr::NonNull;
wrap_command!(BitVec);
wrap!(BitVecCommand;
wrap!(
BitVecCommand {
properties:
prop bitvec: DisplayBitVec { get mut; set move; };
prop offset: Offset { get; set; };
prop operation: BinaryOperation { get; set; };
prop compression: CompressionCode { get; set; };
);
wrap_functions!(associate BitVecCommand;
functions:
/// Set pixel data starting at the pixel offset on screen.
///
/// The screen will continuously overwrite more pixel data without regarding the offset, meaning
@ -42,4 +39,5 @@ wrap_functions!(associate BitVecCommand;
compression,
}
};
}
);

View file

@ -1,19 +1,18 @@
use crate::{
commands::{wrap_command, wrap_origin_accessors},
macros::{wrap, wrap_functions},
macros::wrap,
};
use servicepoint::{BrightnessGrid, BrightnessGridCommand, Origin};
use std::ptr::NonNull;
wrap_command!(BrightnessGrid);
wrap!(BrightnessGridCommand;
prop grid: BrightnessGrid { get mut; set move; };
);
wrap_origin_accessors!(BrightnessGridCommand);
wrap_functions!(associate BrightnessGridCommand;
wrap!(
BrightnessGridCommand {
properties:
prop grid: BrightnessGrid { get mut; set move; };
functions:
/// Set the brightness of individual tiles in a rectangular area of the display.
///
/// The passed [BrightnessGrid] gets consumed.
@ -35,4 +34,5 @@ wrap_functions!(associate BrightnessGridCommand;
fn from_grid(grid: move NonNull<BrightnessGrid>) -> move NonNull<BrightnessGridCommand> {
grid.into()
};
}
);

View file

@ -1,4 +1,4 @@
use crate::{commands::wrap_command, macros::wrap_functions};
use crate::commands::wrap_command;
use servicepoint::{ClearCommand, FadeOutCommand, HardResetCommand};
macro_rules! wrap_cc_only {
@ -6,14 +6,17 @@ macro_rules! wrap_cc_only {
::paste::paste!{
wrap_command!($command);
wrap_functions!(associate [< $command Command >];
$crate::macros::wrap!{
[< $command Command >] {
functions:
$(#[$meta])*
///
#[doc = " Returns: a new [`" [< $command Command >] "`] instance."]
fn new() -> move ::core::ptr::NonNull<[< $command Command >]> {
[< $command Command >]
};
);
}
}
}
};
}

View file

@ -1,19 +1,18 @@
use crate::{
commands::{wrap_command, wrap_origin_accessors},
macros::{wrap, wrap_functions},
macros::wrap,
};
use servicepoint::{CharGrid, CharGridCommand, Origin};
use std::ptr::NonNull;
wrap_command!(CharGrid);
wrap!(CharGridCommand;
prop grid: CharGrid { get mut; set move; };
);
wrap_origin_accessors!(CharGridCommand);
wrap_functions!(associate CharGridCommand;
wrap!(
CharGridCommand {
properties:
prop grid: CharGrid { get mut; set move; };
functions:
/// Show UTF-8 encoded text on the screen.
///
/// The passed [CharGrid] gets consumed.
@ -35,4 +34,5 @@ wrap_functions!(associate CharGridCommand;
fn from_grid(grid: move NonNull<CharGrid>) -> move NonNull<CharGridCommand> {
grid.into()
};
}
);

View file

@ -1,19 +1,18 @@
use crate::{
commands::{wrap_command, wrap_origin_accessors},
macros::{wrap, wrap_functions},
macros::wrap,
};
use servicepoint::{Cp437Grid, Cp437GridCommand, Origin};
use std::ptr::NonNull;
wrap_command!(Cp437Grid);
wrap!(Cp437GridCommand;
prop grid: Cp437Grid { get mut; set move; };
);
wrap_origin_accessors!(Cp437GridCommand);
wrap_functions!(associate Cp437GridCommand;
wrap!(
Cp437GridCommand {
properties:
prop grid: Cp437Grid { get mut; set move; };
functions:
/// Show text on the screen.
///
/// The text is sent in the form of a 2D grid of [CP-437] encoded characters.
@ -35,4 +34,5 @@ wrap_functions!(associate Cp437GridCommand;
fn from_grid(grid: move NonNull<Cp437Grid>) -> move NonNull<Cp437GridCommand> {
grid.into()
};
}
);

View file

@ -1,5 +1,5 @@
use crate::{
macros::{derive_clone, derive_free, wrap, wrap_functions},
macros::{derive_clone, derive_free, wrap},
mem::{
heap_clone, heap_drop, heap_move, heap_move_nonnull, heap_move_ok,
heap_remove,
@ -69,8 +69,6 @@ impl GenericCommand {
};
}
derive_clone!(GenericCommand);
impl Clone for GenericCommand {
fn clone(&self) -> Self {
unsafe {
@ -144,8 +142,6 @@ impl Clone for GenericCommand {
}
}
derive_free!(GenericCommand);
impl Drop for GenericCommand {
fn drop(&mut self) {
unsafe {
@ -172,7 +168,12 @@ impl Drop for GenericCommand {
}
}
wrap_functions!(associate GenericCommand;
derive_clone!(GenericCommand);
derive_free!(GenericCommand);
wrap! {
GenericCommand {
functions:
/// Tries to turn a [Packet] into a [GenericCommand].
///
/// The packet is dropped in the process.
@ -248,14 +249,12 @@ wrap_functions!(associate GenericCommand;
data: CommandUnion { null: null_mut() },
})
};
);
wrap! { GenericCommand;
methods:
/// Tries to turn a [GenericCommand] into a [Packet].
/// The [GenericCommand] gets consumed.
///
/// Returns tag [CommandTag::Invalid] in case of an error.
method try_into_packet(move command) -> val *mut Packet {
fn try_into_packet(move command) -> val *mut Packet {
match command.tag {
CommandTag::Invalid => null_mut(),
CommandTag::Bitmap => {
@ -291,3 +290,4 @@ wrap! { GenericCommand;
}
};
}
}

View file

@ -1,21 +1,19 @@
use crate::{
commands::wrap_command,
macros::{wrap, wrap_functions},
};
use crate::{commands::wrap_command, macros::wrap};
use servicepoint::{Brightness, GlobalBrightnessCommand};
use std::ptr::NonNull;
wrap_functions!(associate GlobalBrightnessCommand;
wrap_command!(GlobalBrightness);
wrap!(
GlobalBrightnessCommand {
properties:
prop brightness: Brightness { get; set; };
functions:
/// Set the brightness of all tiles to the same value.
///
/// Returns: a new [GlobalBrightnessCommand] instance.
fn new(brightness: val Brightness) -> move NonNull<GlobalBrightnessCommand> {
GlobalBrightnessCommand::from(brightness)
};
);
wrap_command!(GlobalBrightness);
wrap!(GlobalBrightnessCommand;
prop brightness: Brightness { get; set; };
}
);

View file

@ -1,6 +1,6 @@
use crate::{
containers::{wrap_grid, ByteSlice},
macros::{wrap, wrap_functions},
macros::wrap,
};
use servicepoint::{
Bitmap, BitmapCommand, CompressionCode, DataRef, DisplayBitVec, Grid,
@ -10,7 +10,9 @@ use std::ptr::NonNull;
wrap_grid!(Bitmap, bool);
wrap_functions!(associate Bitmap;
wrap! {
Bitmap {
functions:
/// Creates a new [Bitmap] with the specified dimensions.
///
/// # Arguments
@ -72,11 +74,10 @@ wrap_functions!(associate Bitmap;
) -> move_ok *mut Bitmap {
Bitmap::from_bitvec(width, bitvec)
};
);
wrap!(Bitmap;
methods:
/// Consumes the Bitmap and returns the contained BitVec.
method into_bitvec(move bitmap) -> move NonNull<DisplayBitVec> {
fn into_bitvec(move bitmap) -> move NonNull<DisplayBitVec> {
bitmap.into()
};
@ -85,7 +86,7 @@ wrap!(Bitmap;
/// The provided [Bitmap] gets consumed.
///
/// Returns NULL in case of an error.
method try_into_packet(move bitmap, x: val usize, y: val usize, compression: val CompressionCode) -> move_ok *mut Packet {
fn try_into_packet(move bitmap, x: val usize, y: val usize, compression: val CompressionCode) -> move_ok *mut Packet {
Packet::try_from(BitmapCommand {
bitmap,
origin: Origin::new(x, y),
@ -96,5 +97,6 @@ wrap!(Bitmap;
/// Gets an unsafe reference to the data of the [Bitmap] instance.
///
/// The returned memory is valid for the lifetime of the bitmap.
method data_ref_mut(mut instance) -> slice ByteSlice;
);
fn data_ref_mut(mut instance) -> slice ByteSlice;
}
}

View file

@ -1,6 +1,6 @@
use crate::{
containers::{wrap_container, ByteSlice},
macros::{wrap, wrap_functions},
macros::wrap,
};
use servicepoint::{
BinaryOperation, BitVecCommand, CompressionCode, DisplayBitVec, Packet,
@ -9,7 +9,9 @@ use std::ptr::NonNull;
wrap_container!(DisplayBitVec);
wrap_functions!(associate DisplayBitVec;
wrap! {
DisplayBitVec {
functions:
/// Creates a new [DisplayBitVec] instance.
///
/// # Arguments
@ -31,15 +33,14 @@ wrap_functions!(associate DisplayBitVec;
fn load(data: slice ByteSlice) -> move NonNull<DisplayBitVec> {
DisplayBitVec::from_slice(data)
};
);
wrap!(DisplayBitVec;
methods:
/// Creates a [BitVecCommand] and immediately turns that into a [Packet].
///
/// The provided [DisplayBitVec] gets consumed.
///
/// Returns NULL in case of an error.
method try_into_packet(
fn try_into_packet(
move bitvec,
offset: val usize,
operation: val BinaryOperation,
@ -65,7 +66,7 @@ wrap!(DisplayBitVec;
/// # Panics
///
/// - when accessing `index` out of bounds
method get(ref instance, index: val usize) -> val bool {
fn get(ref instance, index: val usize) -> val bool {
instance.get(index).map(|x| *x).unwrap_or(false)
};
@ -79,23 +80,24 @@ wrap!(DisplayBitVec;
/// # Panics
///
/// - when accessing `index` out of bounds
method set(mut instance, index: val usize, value: val bool);
fn set(mut instance, index: val usize, value: val bool);
/// Sets the value of all bits.
///
/// # Arguments
///
/// - `value`: the value to set all bits to
method fill(mut instance, value: val bool);
fn fill(mut instance, value: val bool);
/// Gets the length in bits.
method len(ref instance) -> val usize;
fn len(ref instance) -> val usize;
/// Returns true if length is 0.
method is_empty(ref instance) -> val bool;
fn is_empty(ref instance) -> val bool;
/// Gets an unsafe reference to the data of the [DisplayBitVec] instance.
///
/// The returned memory is valid for the lifetime of the bitvec.
method as_raw_mut_slice(mut instance) -> slice ByteSlice;
);
fn as_raw_mut_slice(mut instance) -> slice ByteSlice;
}
}

View file

@ -1,6 +1,6 @@
use crate::{
containers::{wrap_grid, ByteSlice},
macros::{wrap, wrap_functions},
macros::wrap,
};
use servicepoint::{
Brightness, BrightnessGrid, BrightnessGridCommand, ByteGrid, DataRef, Grid,
@ -10,7 +10,9 @@ use std::{mem::transmute, ptr::NonNull};
wrap_grid!(BrightnessGrid, Brightness);
wrap_functions!(associate BrightnessGrid;
wrap! {
BrightnessGrid {
functions:
/// Creates a new [BrightnessGrid] with the specified dimensions.
///
/// returns: [BrightnessGrid] initialized to 0.
@ -45,15 +47,14 @@ wrap_functions!(associate BrightnessGrid;
ByteGrid::load(width, height, data)
.map(move |grid| grid.map(Brightness::saturating_from))
};
);
wrap!(BrightnessGrid;
methods:
/// Creates a [BrightnessGridCommand] and immediately turns that into a [Packet].
///
/// The provided [BrightnessGrid] gets consumed.
///
/// Returns NULL in case of an error.
method try_into_packet(move grid, x: val usize, y: val usize) -> move_ok *mut Packet {
fn try_into_packet(move grid, x: val usize, y: val usize) -> move_ok *mut Packet {
Packet::try_from(BrightnessGridCommand {
grid,
origin: Origin::new(x, y),
@ -63,7 +64,7 @@ wrap!(BrightnessGrid;
/// Gets an unsafe reference to the data of the instance.
///
/// The returned memory is valid for the lifetime of the grid.
method data_ref_mut(mut instance) -> slice ByteSlice {
fn data_ref_mut(mut instance) -> slice ByteSlice {
//noinspection RsAssertEqual
const _: () = assert!(size_of::<Brightness>() == 1);
@ -72,4 +73,5 @@ wrap!(BrightnessGrid;
transmute::<&mut [Brightness], &mut [u8]>(br_slice)
}
};
);
}
}

View file

@ -1,6 +1,6 @@
use crate::{
containers::{derive_get_width_height, wrap_container, ByteSlice},
macros::{wrap, wrap_functions},
macros::wrap,
};
use servicepoint::{CharGrid, CharGridCommand, Grid, Origin, Packet};
use std::ptr::NonNull;
@ -8,7 +8,9 @@ use std::ptr::NonNull;
wrap_container!(CharGrid);
derive_get_width_height!(CharGrid);
wrap_functions!(associate CharGrid;
wrap! {
CharGrid {
functions:
/// Creates a new [CharGrid] with the specified dimensions.
///
/// returns: [CharGrid] initialized to 0.
@ -31,9 +33,7 @@ wrap_functions!(associate CharGrid;
fn load(width: val usize, height: val usize, data: slice ByteSlice) -> move_ok *mut CharGrid {
CharGrid::load_utf8(width, height, data.to_vec())
};
);
wrap!(CharGrid;
methods:
/// Returns the current value at the specified position.
///
/// # Arguments
@ -43,7 +43,7 @@ wrap!(CharGrid;
/// # Panics
///
/// - when accessing `x` or `y` out of bounds
method get(ref instance, x: val usize, y: val usize) -> val u32 {
fn get(ref instance, x: val usize, y: val usize) -> val u32 {
instance.get(x, y) as u32
};
@ -60,7 +60,7 @@ wrap!(CharGrid;
///
/// - when accessing `x` or `y` out of bounds
/// - when providing values that cannot be converted to Rust's `char`.
method set(mut instance, x: val usize, y: val usize, value: val u32) {
fn set(mut instance, x: val usize, y: val usize, value: val u32) {
instance.set(x, y, char::from_u32(value).unwrap())
};
@ -70,7 +70,7 @@ wrap!(CharGrid;
///
/// - `value`: the value to set all cells to
/// - when providing values that cannot be converted to Rust's `char`.
method fill(mut instance, value: val u32) {
fn fill(mut instance, value: val u32) {
instance.fill(char::from_u32(value).unwrap())
};
@ -79,10 +79,11 @@ wrap!(CharGrid;
/// The provided [CharGrid] gets consumed.
///
/// Returns NULL in case of an error.
method try_into_packet(move grid, x: val usize, y: val usize) -> move_ok *mut Packet {
fn try_into_packet(move grid, x: val usize, y: val usize) -> move_ok *mut Packet {
Packet::try_from(CharGridCommand {
grid,
origin: Origin::new(x, y),
})
};
);
}
}

View file

@ -1,6 +1,6 @@
use crate::{
containers::{wrap_grid, ByteSlice},
macros::{wrap, wrap_functions},
macros::wrap,
};
use servicepoint::{
Cp437Grid, Cp437GridCommand, DataRef, Grid, Origin, Packet,
@ -9,7 +9,9 @@ use std::ptr::NonNull;
wrap_grid!(Cp437Grid, u8);
wrap_functions!(associate Cp437Grid;
wrap! {
Cp437Grid {
functions:
/// Creates a new [Cp437Grid] with the specified dimensions.
///
/// returns: [Cp437Grid] initialized to 0.
@ -21,15 +23,14 @@ wrap_functions!(associate Cp437Grid;
fn load(width: val usize, height: val usize, data: slice ByteSlice) -> move_some *mut Cp437Grid {
Cp437Grid::load(width, height, data)
};
);
wrap!(Cp437Grid;
methods:
/// Creates a [Cp437GridCommand] and immediately turns that into a [Packet].
///
/// The provided [Cp437Grid] gets consumed.
///
/// Returns NULL in case of an error.
method try_into_packet(move grid, x: val usize, y: val usize) -> move_ok *mut Packet {
fn try_into_packet(move grid, x: val usize, y: val usize) -> move_ok *mut Packet {
Packet::try_from(Cp437GridCommand {
grid,
origin: Origin::new(x, y),
@ -39,5 +40,6 @@ wrap!(Cp437Grid;
/// Gets an unsafe reference to the data of the grid.
///
/// The returned memory is valid for the lifetime of the instance.
method data_ref_mut(mut instance) -> slice ByteSlice;
);
fn data_ref_mut(mut instance) -> slice ByteSlice;
}
}

View file

@ -265,30 +265,54 @@ macro_rules! wrap_functions {
macro_rules! wrap {
(
$object_type:ident;
$object_type:ident {
$(
properties:
$(
prop $prop_name:ident : $prop_type:ty { $($accessor:ident $($modifier:ident)?;)+ };
)*
)?
$(
$(#[$meta:meta])+
method $function:ident($ref_or_mut:ident $instance:ident $(, $($param_name:ident: $param_modifier:ident $param_type:ty),*)?)
$(-> $return_modifier:ident $return_type:ty)?
$($impl:block)?;
functions:
$(
$(#[$fn_meta:meta])+
fn $fn_name:ident($($fn_param_name:ident: $fn_param_modifier:ident $fn_param_type:ty),*$(,)?)
$(-> $fn_return_modifier:ident $fn_return_type:ty)?
$fn_block:block;
)*
) => {
)?
$(
methods:
$(
$(#[$method_meta:meta])+
fn $method_name:ident($method_instance_modifier:ident $method_instance:ident $(, $($method_param_name:ident: $method_param_modifier:ident $method_param_type:ty),*)?)
$(-> $method_return_modifier:ident $method_return_type:ty)?
$($method_impl:block)?;
)*
)?
}
) => {
$($(
$crate::macros::wrap_fields!($object_type;
prop $prop_name : $prop_type { $($accessor $($modifier)?;)+ };
);
)*
$(
$crate::macros::wrap_method!($object_type;
$(#[$meta])+
fn $function($ref_or_mut $instance $(, $($param_name: $param_modifier $param_type),*)?)
$(-> $return_modifier $return_type)?
$($impl)?;
)*)?
$($(
$crate::macros::wrap_functions!(associate $object_type;
$(#[$fn_meta])+
fn $fn_name($($fn_param_name: $fn_param_modifier $fn_param_type),*)
$(-> $fn_return_modifier $fn_return_type)?
$fn_block;
);
)*
)*)?
$($(
$crate::macros::wrap_method!($object_type;
$(#[$method_meta])+
fn $method_name($method_instance_modifier $method_instance $(, $($method_param_name: $method_param_modifier $method_param_type),*)?)
$(-> $method_return_modifier $method_return_type)?
$($method_impl)?;
);
)*)?
};
}

View file

@ -5,7 +5,14 @@ use crate::{
use servicepoint::{CommandCode, Header, Packet};
use std::ptr::NonNull;
wrap_functions!(associate Packet;
derive_clone!(Packet);
derive_free!(Packet);
wrap! {
Packet {
properties:
prop header: Header { get; get mut; set; };
functions:
/// Tries to load a [Packet] from the passed array with the specified length.
///
/// returns: NULL in case of an error, pointer to the allocated packet otherwise
@ -25,20 +32,13 @@ wrap_functions!(associate Packet;
Packet { header, payload }
};
);
derive_clone!(Packet);
derive_free!(Packet);
wrap! {Packet;
prop header: Header { get; get mut; set; };
methods:
/// Returns a pointer to the current payload of the provided packet.
///
/// Returns an [ByteSlice::INVALID] instance in case the packet does not have any payload.
///
/// The returned memory can be changed and will be valid until a new payload is set.
method get_payload(mut packet) -> val ByteSlice {
fn get_payload(mut packet) -> val ByteSlice {
match &mut packet.payload {
None => ByteSlice::INVALID,
Some(payload) => unsafe { ByteSlice::from_slice(payload) },
@ -48,7 +48,7 @@ wrap! {Packet;
/// Sets the payload of the provided packet to the provided data.
///
/// This makes previous payload pointers invalid.
method set_payload(mut packet, data: val ByteSlice) {
fn set_payload(mut packet, data: val ByteSlice) {
packet.payload = if data == ByteSlice::INVALID {
None
} else {
@ -61,15 +61,15 @@ wrap! {Packet;
/// # Panics
///
/// - if the buffer is not big enough to hold header+payload.
method serialize_to(mut packet, buffer: val ByteSlice) -> val usize {
fn serialize_to(mut packet, buffer: val ByteSlice) -> val usize {
unsafe {
packet.serialize_to(buffer.as_slice_mut()).unwrap_or(0)
}
};
}
}
wrap_functions!(sp;
/// Converts u16 into [CommandCode].
///
/// If the provided value is not valid, false is returned and result is not changed.

View file

@ -1,6 +1,6 @@
use crate::{
commands::{CommandTag, GenericCommand},
macros::{derive_free, wrap, wrap_functions},
macros::{derive_free, wrap},
mem::heap_remove,
};
use servicepoint::{Header, Packet, UdpSocketExt};
@ -12,7 +12,9 @@ use std::{
derive_free!(UdpSocket);
wrap_functions!(associate UdpSocket;
wrap! {
UdpSocket {
functions:
/// Creates a new instance of [UdpSocket].
///
/// returns: NULL if connection fails, or connected instance
@ -46,15 +48,13 @@ wrap_functions!(associate UdpSocket;
let addr = SocketAddrV4::new(Ipv4Addr::from([ip1, ip2, ip3, ip4]), port);
UdpSocket::bind_connect(addr)
};
);
wrap! {UdpSocket;
methods:
/// Sends a [Packet] to the display using the [UdpSocket].
///
/// The passed `packet` gets consumed.
///
/// returns: true in case of success
method send_packet(ref connection, packet: move NonNull<Packet>) -> val bool {
fn send_packet(ref connection, packet: move NonNull<Packet>) -> val bool {
connection.send(&Vec::from(packet)).is_ok()
};
@ -69,7 +69,7 @@ wrap! {UdpSocket;
/// ```C
/// sp_udp_send_command(connection, sp_command_brightness(5));
/// ```
method send_command(ref connection, command: mut NonNull<GenericCommand>) -> val bool {
fn send_command(ref connection, command: mut NonNull<GenericCommand>) -> val bool {
unsafe {
let result = match command.tag {
CommandTag::Invalid => return false,
@ -98,7 +98,7 @@ wrap! {UdpSocket;
/// ```C
/// sp_udp_send_header(connection, sp_command_brightness(5));
/// ```
method send_header(ref udp_connection, header: val Header) -> val bool {
fn send_header(ref udp_connection, header: val Header) -> val bool {
let packet = Packet {
header,
payload: None,
@ -106,6 +106,7 @@ wrap! {UdpSocket;
udp_connection.send(&Vec::from(packet)).is_ok()
};
}
}
mod _hidden {
/// This is a type only used by cbindgen to have a type for pointers.