spring_ai_rs/ai_interface/callback/command/command_data/
mod.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
pub mod cheats;
pub mod debug_drawer;
pub mod drawer;
pub mod group;
pub mod lua;
pub mod other;
pub mod path;
pub mod send;
pub mod trace;
pub mod unit;

use libc::c_void;

// Traits
pub trait CommandData {
    type CDataType: CData;
    fn c_data(&mut self) -> Self::CDataType;
}

pub trait CData {
    fn c_void(&mut self) -> *mut c_void {
        self as *mut _ as *mut c_void
    }
}

// Empty data
pub struct EmptyCommandData {}

impl CommandData for EmptyCommandData {
    type CDataType = EmptyCommandCData;

    fn c_data(&mut self) -> Self::CDataType {
        EmptyCommandCData {}
    }
}

pub struct EmptyCommandCData {}

impl CData for EmptyCommandCData {}