generic wrap
This commit is contained in:
parent
5beea6151a
commit
c65b735f57
|
@ -1,20 +1,19 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
commands::{wrap_command, wrap_origin_accessors},
|
commands::{wrap_command, wrap_origin_accessors},
|
||||||
macros::{wrap, wrap_functions},
|
macros::wrap,
|
||||||
};
|
};
|
||||||
use servicepoint::{Bitmap, BitmapCommand, CompressionCode, Origin};
|
use servicepoint::{Bitmap, BitmapCommand, CompressionCode, Origin};
|
||||||
use std::ptr::NonNull;
|
use std::ptr::NonNull;
|
||||||
|
|
||||||
wrap_command!(Bitmap);
|
wrap_command!(Bitmap);
|
||||||
|
|
||||||
wrap!(BitmapCommand;
|
|
||||||
prop bitmap: Bitmap { get mut; set move; };
|
|
||||||
prop compression: CompressionCode { get; set; };
|
|
||||||
);
|
|
||||||
|
|
||||||
wrap_origin_accessors!(BitmapCommand);
|
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.
|
/// Sets a window of pixels to the specified values.
|
||||||
///
|
///
|
||||||
/// The passed [Bitmap] gets consumed.
|
/// The passed [Bitmap] gets consumed.
|
||||||
|
@ -40,4 +39,5 @@ wrap_functions!(associate BitmapCommand;
|
||||||
fn from_bitmap(bitmap: move NonNull<Bitmap>) -> move NonNull<BitmapCommand> {
|
fn from_bitmap(bitmap: move NonNull<Bitmap>) -> move NonNull<BitmapCommand> {
|
||||||
bitmap.into()
|
bitmap.into()
|
||||||
};
|
};
|
||||||
);
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,7 +1,4 @@
|
||||||
use crate::{
|
use crate::{commands::wrap_command, macros::wrap};
|
||||||
commands::wrap_command,
|
|
||||||
macros::{wrap, wrap_functions},
|
|
||||||
};
|
|
||||||
use servicepoint::{
|
use servicepoint::{
|
||||||
BinaryOperation, BitVecCommand, CompressionCode, DisplayBitVec, Offset,
|
BinaryOperation, BitVecCommand, CompressionCode, DisplayBitVec, Offset,
|
||||||
};
|
};
|
||||||
|
@ -9,14 +6,14 @@ use std::ptr::NonNull;
|
||||||
|
|
||||||
wrap_command!(BitVec);
|
wrap_command!(BitVec);
|
||||||
|
|
||||||
wrap!(BitVecCommand;
|
wrap!(
|
||||||
|
BitVecCommand {
|
||||||
|
properties:
|
||||||
prop bitvec: DisplayBitVec { get mut; set move; };
|
prop bitvec: DisplayBitVec { get mut; set move; };
|
||||||
prop offset: Offset { get; set; };
|
prop offset: Offset { get; set; };
|
||||||
prop operation: BinaryOperation { get; set; };
|
prop operation: BinaryOperation { get; set; };
|
||||||
prop compression: CompressionCode { get; set; };
|
prop compression: CompressionCode { get; set; };
|
||||||
);
|
functions:
|
||||||
|
|
||||||
wrap_functions!(associate BitVecCommand;
|
|
||||||
/// Set pixel data starting at the pixel offset on screen.
|
/// Set pixel data starting at the pixel offset on screen.
|
||||||
///
|
///
|
||||||
/// The screen will continuously overwrite more pixel data without regarding the offset, meaning
|
/// The screen will continuously overwrite more pixel data without regarding the offset, meaning
|
||||||
|
@ -42,4 +39,5 @@ wrap_functions!(associate BitVecCommand;
|
||||||
compression,
|
compression,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,19 +1,18 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
commands::{wrap_command, wrap_origin_accessors},
|
commands::{wrap_command, wrap_origin_accessors},
|
||||||
macros::{wrap, wrap_functions},
|
macros::wrap,
|
||||||
};
|
};
|
||||||
use servicepoint::{BrightnessGrid, BrightnessGridCommand, Origin};
|
use servicepoint::{BrightnessGrid, BrightnessGridCommand, Origin};
|
||||||
use std::ptr::NonNull;
|
use std::ptr::NonNull;
|
||||||
|
|
||||||
wrap_command!(BrightnessGrid);
|
wrap_command!(BrightnessGrid);
|
||||||
|
|
||||||
wrap!(BrightnessGridCommand;
|
|
||||||
prop grid: BrightnessGrid { get mut; set move; };
|
|
||||||
);
|
|
||||||
|
|
||||||
wrap_origin_accessors!(BrightnessGridCommand);
|
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.
|
/// Set the brightness of individual tiles in a rectangular area of the display.
|
||||||
///
|
///
|
||||||
/// The passed [BrightnessGrid] gets consumed.
|
/// The passed [BrightnessGrid] gets consumed.
|
||||||
|
@ -35,4 +34,5 @@ wrap_functions!(associate BrightnessGridCommand;
|
||||||
fn from_grid(grid: move NonNull<BrightnessGrid>) -> move NonNull<BrightnessGridCommand> {
|
fn from_grid(grid: move NonNull<BrightnessGrid>) -> move NonNull<BrightnessGridCommand> {
|
||||||
grid.into()
|
grid.into()
|
||||||
};
|
};
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use crate::{commands::wrap_command, macros::wrap_functions};
|
use crate::commands::wrap_command;
|
||||||
use servicepoint::{ClearCommand, FadeOutCommand, HardResetCommand};
|
use servicepoint::{ClearCommand, FadeOutCommand, HardResetCommand};
|
||||||
|
|
||||||
macro_rules! wrap_cc_only {
|
macro_rules! wrap_cc_only {
|
||||||
|
@ -6,14 +6,17 @@ macro_rules! wrap_cc_only {
|
||||||
::paste::paste!{
|
::paste::paste!{
|
||||||
wrap_command!($command);
|
wrap_command!($command);
|
||||||
|
|
||||||
wrap_functions!(associate [< $command Command >];
|
$crate::macros::wrap!{
|
||||||
|
[< $command Command >] {
|
||||||
|
functions:
|
||||||
$(#[$meta])*
|
$(#[$meta])*
|
||||||
///
|
///
|
||||||
#[doc = " Returns: a new [`" [< $command Command >] "`] instance."]
|
#[doc = " Returns: a new [`" [< $command Command >] "`] instance."]
|
||||||
fn new() -> move ::core::ptr::NonNull<[< $command Command >]> {
|
fn new() -> move ::core::ptr::NonNull<[< $command Command >]> {
|
||||||
[< $command Command >]
|
[< $command Command >]
|
||||||
};
|
};
|
||||||
);
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,19 +1,18 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
commands::{wrap_command, wrap_origin_accessors},
|
commands::{wrap_command, wrap_origin_accessors},
|
||||||
macros::{wrap, wrap_functions},
|
macros::wrap,
|
||||||
};
|
};
|
||||||
use servicepoint::{CharGrid, CharGridCommand, Origin};
|
use servicepoint::{CharGrid, CharGridCommand, Origin};
|
||||||
use std::ptr::NonNull;
|
use std::ptr::NonNull;
|
||||||
|
|
||||||
wrap_command!(CharGrid);
|
wrap_command!(CharGrid);
|
||||||
|
|
||||||
wrap!(CharGridCommand;
|
|
||||||
prop grid: CharGrid { get mut; set move; };
|
|
||||||
);
|
|
||||||
|
|
||||||
wrap_origin_accessors!(CharGridCommand);
|
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.
|
/// Show UTF-8 encoded text on the screen.
|
||||||
///
|
///
|
||||||
/// The passed [CharGrid] gets consumed.
|
/// The passed [CharGrid] gets consumed.
|
||||||
|
@ -35,4 +34,5 @@ wrap_functions!(associate CharGridCommand;
|
||||||
fn from_grid(grid: move NonNull<CharGrid>) -> move NonNull<CharGridCommand> {
|
fn from_grid(grid: move NonNull<CharGrid>) -> move NonNull<CharGridCommand> {
|
||||||
grid.into()
|
grid.into()
|
||||||
};
|
};
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,19 +1,18 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
commands::{wrap_command, wrap_origin_accessors},
|
commands::{wrap_command, wrap_origin_accessors},
|
||||||
macros::{wrap, wrap_functions},
|
macros::wrap,
|
||||||
};
|
};
|
||||||
use servicepoint::{Cp437Grid, Cp437GridCommand, Origin};
|
use servicepoint::{Cp437Grid, Cp437GridCommand, Origin};
|
||||||
use std::ptr::NonNull;
|
use std::ptr::NonNull;
|
||||||
|
|
||||||
wrap_command!(Cp437Grid);
|
wrap_command!(Cp437Grid);
|
||||||
|
|
||||||
wrap!(Cp437GridCommand;
|
|
||||||
prop grid: Cp437Grid { get mut; set move; };
|
|
||||||
);
|
|
||||||
|
|
||||||
wrap_origin_accessors!(Cp437GridCommand);
|
wrap_origin_accessors!(Cp437GridCommand);
|
||||||
|
|
||||||
wrap_functions!(associate Cp437GridCommand;
|
wrap!(
|
||||||
|
Cp437GridCommand {
|
||||||
|
properties:
|
||||||
|
prop grid: Cp437Grid { get mut; set move; };
|
||||||
|
functions:
|
||||||
/// Show text on the screen.
|
/// Show text on the screen.
|
||||||
///
|
///
|
||||||
/// The text is sent in the form of a 2D grid of [CP-437] encoded characters.
|
/// 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> {
|
fn from_grid(grid: move NonNull<Cp437Grid>) -> move NonNull<Cp437GridCommand> {
|
||||||
grid.into()
|
grid.into()
|
||||||
};
|
};
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
macros::{derive_clone, derive_free, wrap, wrap_functions},
|
macros::{derive_clone, derive_free, wrap},
|
||||||
mem::{
|
mem::{
|
||||||
heap_clone, heap_drop, heap_move, heap_move_nonnull, heap_move_ok,
|
heap_clone, heap_drop, heap_move, heap_move_nonnull, heap_move_ok,
|
||||||
heap_remove,
|
heap_remove,
|
||||||
|
@ -69,8 +69,6 @@ impl GenericCommand {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
derive_clone!(GenericCommand);
|
|
||||||
|
|
||||||
impl Clone for GenericCommand {
|
impl Clone for GenericCommand {
|
||||||
fn clone(&self) -> Self {
|
fn clone(&self) -> Self {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
@ -144,8 +142,6 @@ impl Clone for GenericCommand {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
derive_free!(GenericCommand);
|
|
||||||
|
|
||||||
impl Drop for GenericCommand {
|
impl Drop for GenericCommand {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
unsafe {
|
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].
|
/// Tries to turn a [Packet] into a [GenericCommand].
|
||||||
///
|
///
|
||||||
/// The packet is dropped in the process.
|
/// The packet is dropped in the process.
|
||||||
|
@ -248,14 +249,12 @@ wrap_functions!(associate GenericCommand;
|
||||||
data: CommandUnion { null: null_mut() },
|
data: CommandUnion { null: null_mut() },
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
);
|
methods:
|
||||||
|
|
||||||
wrap! { GenericCommand;
|
|
||||||
/// Tries to turn a [GenericCommand] into a [Packet].
|
/// Tries to turn a [GenericCommand] into a [Packet].
|
||||||
/// The [GenericCommand] gets consumed.
|
/// The [GenericCommand] gets consumed.
|
||||||
///
|
///
|
||||||
/// Returns tag [CommandTag::Invalid] in case of an error.
|
/// 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 {
|
match command.tag {
|
||||||
CommandTag::Invalid => null_mut(),
|
CommandTag::Invalid => null_mut(),
|
||||||
CommandTag::Bitmap => {
|
CommandTag::Bitmap => {
|
||||||
|
@ -291,3 +290,4 @@ wrap! { GenericCommand;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,21 +1,19 @@
|
||||||
use crate::{
|
use crate::{commands::wrap_command, macros::wrap};
|
||||||
commands::wrap_command,
|
|
||||||
macros::{wrap, wrap_functions},
|
|
||||||
};
|
|
||||||
use servicepoint::{Brightness, GlobalBrightnessCommand};
|
use servicepoint::{Brightness, GlobalBrightnessCommand};
|
||||||
use std::ptr::NonNull;
|
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.
|
/// Set the brightness of all tiles to the same value.
|
||||||
///
|
///
|
||||||
/// Returns: a new [GlobalBrightnessCommand] instance.
|
/// Returns: a new [GlobalBrightnessCommand] instance.
|
||||||
fn new(brightness: val Brightness) -> move NonNull<GlobalBrightnessCommand> {
|
fn new(brightness: val Brightness) -> move NonNull<GlobalBrightnessCommand> {
|
||||||
GlobalBrightnessCommand::from(brightness)
|
GlobalBrightnessCommand::from(brightness)
|
||||||
};
|
};
|
||||||
);
|
}
|
||||||
|
|
||||||
wrap_command!(GlobalBrightness);
|
|
||||||
|
|
||||||
wrap!(GlobalBrightnessCommand;
|
|
||||||
prop brightness: Brightness { get; set; };
|
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
containers::{wrap_grid, ByteSlice},
|
containers::{wrap_grid, ByteSlice},
|
||||||
macros::{wrap, wrap_functions},
|
macros::wrap,
|
||||||
};
|
};
|
||||||
use servicepoint::{
|
use servicepoint::{
|
||||||
Bitmap, BitmapCommand, CompressionCode, DataRef, DisplayBitVec, Grid,
|
Bitmap, BitmapCommand, CompressionCode, DataRef, DisplayBitVec, Grid,
|
||||||
|
@ -10,7 +10,9 @@ use std::ptr::NonNull;
|
||||||
|
|
||||||
wrap_grid!(Bitmap, bool);
|
wrap_grid!(Bitmap, bool);
|
||||||
|
|
||||||
wrap_functions!(associate Bitmap;
|
wrap! {
|
||||||
|
Bitmap {
|
||||||
|
functions:
|
||||||
/// Creates a new [Bitmap] with the specified dimensions.
|
/// Creates a new [Bitmap] with the specified dimensions.
|
||||||
///
|
///
|
||||||
/// # Arguments
|
/// # Arguments
|
||||||
|
@ -72,11 +74,10 @@ wrap_functions!(associate Bitmap;
|
||||||
) -> move_ok *mut Bitmap {
|
) -> move_ok *mut Bitmap {
|
||||||
Bitmap::from_bitvec(width, bitvec)
|
Bitmap::from_bitvec(width, bitvec)
|
||||||
};
|
};
|
||||||
);
|
|
||||||
|
|
||||||
wrap!(Bitmap;
|
methods:
|
||||||
/// Consumes the Bitmap and returns the contained BitVec.
|
/// 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()
|
bitmap.into()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -85,7 +86,7 @@ wrap!(Bitmap;
|
||||||
/// The provided [Bitmap] gets consumed.
|
/// The provided [Bitmap] gets consumed.
|
||||||
///
|
///
|
||||||
/// Returns NULL in case of an error.
|
/// 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 {
|
Packet::try_from(BitmapCommand {
|
||||||
bitmap,
|
bitmap,
|
||||||
origin: Origin::new(x, y),
|
origin: Origin::new(x, y),
|
||||||
|
@ -96,5 +97,6 @@ wrap!(Bitmap;
|
||||||
/// Gets an unsafe reference to the data of the [Bitmap] instance.
|
/// Gets an unsafe reference to the data of the [Bitmap] instance.
|
||||||
///
|
///
|
||||||
/// The returned memory is valid for the lifetime of the bitmap.
|
/// 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;
|
||||||
);
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
containers::{wrap_container, ByteSlice},
|
containers::{wrap_container, ByteSlice},
|
||||||
macros::{wrap, wrap_functions},
|
macros::wrap,
|
||||||
};
|
};
|
||||||
use servicepoint::{
|
use servicepoint::{
|
||||||
BinaryOperation, BitVecCommand, CompressionCode, DisplayBitVec, Packet,
|
BinaryOperation, BitVecCommand, CompressionCode, DisplayBitVec, Packet,
|
||||||
|
@ -9,7 +9,9 @@ use std::ptr::NonNull;
|
||||||
|
|
||||||
wrap_container!(DisplayBitVec);
|
wrap_container!(DisplayBitVec);
|
||||||
|
|
||||||
wrap_functions!(associate DisplayBitVec;
|
wrap! {
|
||||||
|
DisplayBitVec {
|
||||||
|
functions:
|
||||||
/// Creates a new [DisplayBitVec] instance.
|
/// Creates a new [DisplayBitVec] instance.
|
||||||
///
|
///
|
||||||
/// # Arguments
|
/// # Arguments
|
||||||
|
@ -31,15 +33,14 @@ wrap_functions!(associate DisplayBitVec;
|
||||||
fn load(data: slice ByteSlice) -> move NonNull<DisplayBitVec> {
|
fn load(data: slice ByteSlice) -> move NonNull<DisplayBitVec> {
|
||||||
DisplayBitVec::from_slice(data)
|
DisplayBitVec::from_slice(data)
|
||||||
};
|
};
|
||||||
);
|
|
||||||
|
|
||||||
wrap!(DisplayBitVec;
|
methods:
|
||||||
/// Creates a [BitVecCommand] and immediately turns that into a [Packet].
|
/// Creates a [BitVecCommand] and immediately turns that into a [Packet].
|
||||||
///
|
///
|
||||||
/// The provided [DisplayBitVec] gets consumed.
|
/// The provided [DisplayBitVec] gets consumed.
|
||||||
///
|
///
|
||||||
/// Returns NULL in case of an error.
|
/// Returns NULL in case of an error.
|
||||||
method try_into_packet(
|
fn try_into_packet(
|
||||||
move bitvec,
|
move bitvec,
|
||||||
offset: val usize,
|
offset: val usize,
|
||||||
operation: val BinaryOperation,
|
operation: val BinaryOperation,
|
||||||
|
@ -65,7 +66,7 @@ wrap!(DisplayBitVec;
|
||||||
/// # Panics
|
/// # Panics
|
||||||
///
|
///
|
||||||
/// - when accessing `index` out of bounds
|
/// - 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)
|
instance.get(index).map(|x| *x).unwrap_or(false)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -79,23 +80,24 @@ wrap!(DisplayBitVec;
|
||||||
/// # Panics
|
/// # Panics
|
||||||
///
|
///
|
||||||
/// - when accessing `index` out of bounds
|
/// - 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.
|
/// Sets the value of all bits.
|
||||||
///
|
///
|
||||||
/// # Arguments
|
/// # Arguments
|
||||||
///
|
///
|
||||||
/// - `value`: the value to set all bits to
|
/// - `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.
|
/// Gets the length in bits.
|
||||||
method len(ref instance) -> val usize;
|
fn len(ref instance) -> val usize;
|
||||||
|
|
||||||
/// Returns true if length is 0.
|
/// 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.
|
/// Gets an unsafe reference to the data of the [DisplayBitVec] instance.
|
||||||
///
|
///
|
||||||
/// The returned memory is valid for the lifetime of the bitvec.
|
/// 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;
|
||||||
);
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
containers::{wrap_grid, ByteSlice},
|
containers::{wrap_grid, ByteSlice},
|
||||||
macros::{wrap, wrap_functions},
|
macros::wrap,
|
||||||
};
|
};
|
||||||
use servicepoint::{
|
use servicepoint::{
|
||||||
Brightness, BrightnessGrid, BrightnessGridCommand, ByteGrid, DataRef, Grid,
|
Brightness, BrightnessGrid, BrightnessGridCommand, ByteGrid, DataRef, Grid,
|
||||||
|
@ -10,7 +10,9 @@ use std::{mem::transmute, ptr::NonNull};
|
||||||
|
|
||||||
wrap_grid!(BrightnessGrid, Brightness);
|
wrap_grid!(BrightnessGrid, Brightness);
|
||||||
|
|
||||||
wrap_functions!(associate BrightnessGrid;
|
wrap! {
|
||||||
|
BrightnessGrid {
|
||||||
|
functions:
|
||||||
/// Creates a new [BrightnessGrid] with the specified dimensions.
|
/// Creates a new [BrightnessGrid] with the specified dimensions.
|
||||||
///
|
///
|
||||||
/// returns: [BrightnessGrid] initialized to 0.
|
/// returns: [BrightnessGrid] initialized to 0.
|
||||||
|
@ -45,15 +47,14 @@ wrap_functions!(associate BrightnessGrid;
|
||||||
ByteGrid::load(width, height, data)
|
ByteGrid::load(width, height, data)
|
||||||
.map(move |grid| grid.map(Brightness::saturating_from))
|
.map(move |grid| grid.map(Brightness::saturating_from))
|
||||||
};
|
};
|
||||||
);
|
|
||||||
|
|
||||||
wrap!(BrightnessGrid;
|
methods:
|
||||||
/// Creates a [BrightnessGridCommand] and immediately turns that into a [Packet].
|
/// Creates a [BrightnessGridCommand] and immediately turns that into a [Packet].
|
||||||
///
|
///
|
||||||
/// The provided [BrightnessGrid] gets consumed.
|
/// The provided [BrightnessGrid] gets consumed.
|
||||||
///
|
///
|
||||||
/// Returns NULL in case of an error.
|
/// 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 {
|
Packet::try_from(BrightnessGridCommand {
|
||||||
grid,
|
grid,
|
||||||
origin: Origin::new(x, y),
|
origin: Origin::new(x, y),
|
||||||
|
@ -63,7 +64,7 @@ wrap!(BrightnessGrid;
|
||||||
/// Gets an unsafe reference to the data of the instance.
|
/// Gets an unsafe reference to the data of the instance.
|
||||||
///
|
///
|
||||||
/// The returned memory is valid for the lifetime of the grid.
|
/// 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
|
//noinspection RsAssertEqual
|
||||||
const _: () = assert!(size_of::<Brightness>() == 1);
|
const _: () = assert!(size_of::<Brightness>() == 1);
|
||||||
|
|
||||||
|
@ -72,4 +73,5 @@ wrap!(BrightnessGrid;
|
||||||
transmute::<&mut [Brightness], &mut [u8]>(br_slice)
|
transmute::<&mut [Brightness], &mut [u8]>(br_slice)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
);
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
containers::{derive_get_width_height, wrap_container, ByteSlice},
|
containers::{derive_get_width_height, wrap_container, ByteSlice},
|
||||||
macros::{wrap, wrap_functions},
|
macros::wrap,
|
||||||
};
|
};
|
||||||
use servicepoint::{CharGrid, CharGridCommand, Grid, Origin, Packet};
|
use servicepoint::{CharGrid, CharGridCommand, Grid, Origin, Packet};
|
||||||
use std::ptr::NonNull;
|
use std::ptr::NonNull;
|
||||||
|
@ -8,7 +8,9 @@ use std::ptr::NonNull;
|
||||||
wrap_container!(CharGrid);
|
wrap_container!(CharGrid);
|
||||||
derive_get_width_height!(CharGrid);
|
derive_get_width_height!(CharGrid);
|
||||||
|
|
||||||
wrap_functions!(associate CharGrid;
|
wrap! {
|
||||||
|
CharGrid {
|
||||||
|
functions:
|
||||||
/// Creates a new [CharGrid] with the specified dimensions.
|
/// Creates a new [CharGrid] with the specified dimensions.
|
||||||
///
|
///
|
||||||
/// returns: [CharGrid] initialized to 0.
|
/// 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 {
|
fn load(width: val usize, height: val usize, data: slice ByteSlice) -> move_ok *mut CharGrid {
|
||||||
CharGrid::load_utf8(width, height, data.to_vec())
|
CharGrid::load_utf8(width, height, data.to_vec())
|
||||||
};
|
};
|
||||||
);
|
methods:
|
||||||
|
|
||||||
wrap!(CharGrid;
|
|
||||||
/// Returns the current value at the specified position.
|
/// Returns the current value at the specified position.
|
||||||
///
|
///
|
||||||
/// # Arguments
|
/// # Arguments
|
||||||
|
@ -43,7 +43,7 @@ wrap!(CharGrid;
|
||||||
/// # Panics
|
/// # Panics
|
||||||
///
|
///
|
||||||
/// - when accessing `x` or `y` out of bounds
|
/// - 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
|
instance.get(x, y) as u32
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ wrap!(CharGrid;
|
||||||
///
|
///
|
||||||
/// - when accessing `x` or `y` out of bounds
|
/// - when accessing `x` or `y` out of bounds
|
||||||
/// - when providing values that cannot be converted to Rust's `char`.
|
/// - 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())
|
instance.set(x, y, char::from_u32(value).unwrap())
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ wrap!(CharGrid;
|
||||||
///
|
///
|
||||||
/// - `value`: the value to set all cells to
|
/// - `value`: the value to set all cells to
|
||||||
/// - when providing values that cannot be converted to Rust's `char`.
|
/// - 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())
|
instance.fill(char::from_u32(value).unwrap())
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -79,10 +79,11 @@ wrap!(CharGrid;
|
||||||
/// The provided [CharGrid] gets consumed.
|
/// The provided [CharGrid] gets consumed.
|
||||||
///
|
///
|
||||||
/// Returns NULL in case of an error.
|
/// 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 {
|
Packet::try_from(CharGridCommand {
|
||||||
grid,
|
grid,
|
||||||
origin: Origin::new(x, y),
|
origin: Origin::new(x, y),
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
);
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
containers::{wrap_grid, ByteSlice},
|
containers::{wrap_grid, ByteSlice},
|
||||||
macros::{wrap, wrap_functions},
|
macros::wrap,
|
||||||
};
|
};
|
||||||
use servicepoint::{
|
use servicepoint::{
|
||||||
Cp437Grid, Cp437GridCommand, DataRef, Grid, Origin, Packet,
|
Cp437Grid, Cp437GridCommand, DataRef, Grid, Origin, Packet,
|
||||||
|
@ -9,7 +9,9 @@ use std::ptr::NonNull;
|
||||||
|
|
||||||
wrap_grid!(Cp437Grid, u8);
|
wrap_grid!(Cp437Grid, u8);
|
||||||
|
|
||||||
wrap_functions!(associate Cp437Grid;
|
wrap! {
|
||||||
|
Cp437Grid {
|
||||||
|
functions:
|
||||||
/// Creates a new [Cp437Grid] with the specified dimensions.
|
/// Creates a new [Cp437Grid] with the specified dimensions.
|
||||||
///
|
///
|
||||||
/// returns: [Cp437Grid] initialized to 0.
|
/// 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 {
|
fn load(width: val usize, height: val usize, data: slice ByteSlice) -> move_some *mut Cp437Grid {
|
||||||
Cp437Grid::load(width, height, data)
|
Cp437Grid::load(width, height, data)
|
||||||
};
|
};
|
||||||
);
|
|
||||||
|
|
||||||
wrap!(Cp437Grid;
|
methods:
|
||||||
/// Creates a [Cp437GridCommand] and immediately turns that into a [Packet].
|
/// Creates a [Cp437GridCommand] and immediately turns that into a [Packet].
|
||||||
///
|
///
|
||||||
/// The provided [Cp437Grid] gets consumed.
|
/// The provided [Cp437Grid] gets consumed.
|
||||||
///
|
///
|
||||||
/// Returns NULL in case of an error.
|
/// 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 {
|
Packet::try_from(Cp437GridCommand {
|
||||||
grid,
|
grid,
|
||||||
origin: Origin::new(x, y),
|
origin: Origin::new(x, y),
|
||||||
|
@ -39,5 +40,6 @@ wrap!(Cp437Grid;
|
||||||
/// Gets an unsafe reference to the data of the grid.
|
/// Gets an unsafe reference to the data of the grid.
|
||||||
///
|
///
|
||||||
/// The returned memory is valid for the lifetime of the instance.
|
/// 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;
|
||||||
);
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -265,30 +265,54 @@ macro_rules! wrap_functions {
|
||||||
|
|
||||||
macro_rules! wrap {
|
macro_rules! wrap {
|
||||||
(
|
(
|
||||||
$object_type:ident;
|
$object_type:ident {
|
||||||
|
$(
|
||||||
|
properties:
|
||||||
$(
|
$(
|
||||||
prop $prop_name:ident : $prop_type:ty { $($accessor:ident $($modifier:ident)?;)+ };
|
prop $prop_name:ident : $prop_type:ty { $($accessor:ident $($modifier:ident)?;)+ };
|
||||||
)*
|
)*
|
||||||
|
)?
|
||||||
$(
|
$(
|
||||||
$(#[$meta:meta])+
|
functions:
|
||||||
method $function:ident($ref_or_mut:ident $instance:ident $(, $($param_name:ident: $param_modifier:ident $param_type:ty),*)?)
|
$(
|
||||||
$(-> $return_modifier:ident $return_type:ty)?
|
$(#[$fn_meta:meta])+
|
||||||
$($impl:block)?;
|
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;
|
$crate::macros::wrap_fields!($object_type;
|
||||||
prop $prop_name : $prop_type { $($accessor $($modifier)?;)+ };
|
prop $prop_name : $prop_type { $($accessor $($modifier)?;)+ };
|
||||||
);
|
);
|
||||||
)*
|
)*)?
|
||||||
$(
|
$($(
|
||||||
$crate::macros::wrap_method!($object_type;
|
$crate::macros::wrap_functions!(associate $object_type;
|
||||||
$(#[$meta])+
|
$(#[$fn_meta])+
|
||||||
fn $function($ref_or_mut $instance $(, $($param_name: $param_modifier $param_type),*)?)
|
fn $fn_name($($fn_param_name: $fn_param_modifier $fn_param_type),*)
|
||||||
$(-> $return_modifier $return_type)?
|
$(-> $fn_return_modifier $fn_return_type)?
|
||||||
$($impl)?;
|
$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)?;
|
||||||
|
);
|
||||||
|
)*)?
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,14 @@ use crate::{
|
||||||
use servicepoint::{CommandCode, Header, Packet};
|
use servicepoint::{CommandCode, Header, Packet};
|
||||||
use std::ptr::NonNull;
|
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.
|
/// 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
|
/// returns: NULL in case of an error, pointer to the allocated packet otherwise
|
||||||
|
@ -25,20 +32,13 @@ wrap_functions!(associate Packet;
|
||||||
|
|
||||||
Packet { header, payload }
|
Packet { header, payload }
|
||||||
};
|
};
|
||||||
);
|
methods:
|
||||||
|
|
||||||
derive_clone!(Packet);
|
|
||||||
derive_free!(Packet);
|
|
||||||
|
|
||||||
wrap! {Packet;
|
|
||||||
prop header: Header { get; get mut; set; };
|
|
||||||
|
|
||||||
/// Returns a pointer to the current payload of the provided packet.
|
/// 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.
|
/// 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.
|
/// 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 {
|
match &mut packet.payload {
|
||||||
None => ByteSlice::INVALID,
|
None => ByteSlice::INVALID,
|
||||||
Some(payload) => unsafe { ByteSlice::from_slice(payload) },
|
Some(payload) => unsafe { ByteSlice::from_slice(payload) },
|
||||||
|
@ -48,7 +48,7 @@ wrap! {Packet;
|
||||||
/// Sets the payload of the provided packet to the provided data.
|
/// Sets the payload of the provided packet to the provided data.
|
||||||
///
|
///
|
||||||
/// This makes previous payload pointers invalid.
|
/// 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 {
|
packet.payload = if data == ByteSlice::INVALID {
|
||||||
None
|
None
|
||||||
} else {
|
} else {
|
||||||
|
@ -61,15 +61,15 @@ wrap! {Packet;
|
||||||
/// # Panics
|
/// # Panics
|
||||||
///
|
///
|
||||||
/// - if the buffer is not big enough to hold header+payload.
|
/// - 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 {
|
unsafe {
|
||||||
packet.serialize_to(buffer.as_slice_mut()).unwrap_or(0)
|
packet.serialize_to(buffer.as_slice_mut()).unwrap_or(0)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
wrap_functions!(sp;
|
wrap_functions!(sp;
|
||||||
|
|
||||||
/// Converts u16 into [CommandCode].
|
/// Converts u16 into [CommandCode].
|
||||||
///
|
///
|
||||||
/// If the provided value is not valid, false is returned and result is not changed.
|
/// If the provided value is not valid, false is returned and result is not changed.
|
||||||
|
|
17
src/udp.rs
17
src/udp.rs
|
@ -1,6 +1,6 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
commands::{CommandTag, GenericCommand},
|
commands::{CommandTag, GenericCommand},
|
||||||
macros::{derive_free, wrap, wrap_functions},
|
macros::{derive_free, wrap},
|
||||||
mem::heap_remove,
|
mem::heap_remove,
|
||||||
};
|
};
|
||||||
use servicepoint::{Header, Packet, UdpSocketExt};
|
use servicepoint::{Header, Packet, UdpSocketExt};
|
||||||
|
@ -12,7 +12,9 @@ use std::{
|
||||||
|
|
||||||
derive_free!(UdpSocket);
|
derive_free!(UdpSocket);
|
||||||
|
|
||||||
wrap_functions!(associate UdpSocket;
|
wrap! {
|
||||||
|
UdpSocket {
|
||||||
|
functions:
|
||||||
/// Creates a new instance of [UdpSocket].
|
/// Creates a new instance of [UdpSocket].
|
||||||
///
|
///
|
||||||
/// returns: NULL if connection fails, or connected instance
|
/// 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);
|
let addr = SocketAddrV4::new(Ipv4Addr::from([ip1, ip2, ip3, ip4]), port);
|
||||||
UdpSocket::bind_connect(addr)
|
UdpSocket::bind_connect(addr)
|
||||||
};
|
};
|
||||||
);
|
methods:
|
||||||
|
|
||||||
wrap! {UdpSocket;
|
|
||||||
/// Sends a [Packet] to the display using the [UdpSocket].
|
/// Sends a [Packet] to the display using the [UdpSocket].
|
||||||
///
|
///
|
||||||
/// The passed `packet` gets consumed.
|
/// The passed `packet` gets consumed.
|
||||||
///
|
///
|
||||||
/// returns: true in case of success
|
/// 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()
|
connection.send(&Vec::from(packet)).is_ok()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ wrap! {UdpSocket;
|
||||||
/// ```C
|
/// ```C
|
||||||
/// sp_udp_send_command(connection, sp_command_brightness(5));
|
/// 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 {
|
unsafe {
|
||||||
let result = match command.tag {
|
let result = match command.tag {
|
||||||
CommandTag::Invalid => return false,
|
CommandTag::Invalid => return false,
|
||||||
|
@ -98,7 +98,7 @@ wrap! {UdpSocket;
|
||||||
/// ```C
|
/// ```C
|
||||||
/// sp_udp_send_header(connection, sp_command_brightness(5));
|
/// 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 {
|
let packet = Packet {
|
||||||
header,
|
header,
|
||||||
payload: None,
|
payload: None,
|
||||||
|
@ -106,6 +106,7 @@ wrap! {UdpSocket;
|
||||||
udp_connection.send(&Vec::from(packet)).is_ok()
|
udp_connection.send(&Vec::from(packet)).is_ok()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
mod _hidden {
|
mod _hidden {
|
||||||
/// This is a type only used by cbindgen to have a type for pointers.
|
/// This is a type only used by cbindgen to have a type for pointers.
|
||||||
|
|
Loading…
Reference in a new issue