|
|
|
@@ -1,18 +1,150 @@ |
|
|
|
/*! \file */ |
|
|
|
/******************************************* |
|
|
|
* * |
|
|
|
* File auto-generated by `::safer_ffi`. * |
|
|
|
* * |
|
|
|
* Do not manually edit this file. * |
|
|
|
* * |
|
|
|
*******************************************/ |
|
|
|
|
|
|
|
#ifndef __RUST_DORA_OPERATOR_API_C__ |
|
|
|
#define __RUST_DORA_OPERATOR_API_C__ |
|
|
|
#ifdef __cplusplus |
|
|
|
extern "C" { |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#include <stddef.h> |
|
|
|
#include <stdint.h> |
|
|
|
|
|
|
|
/** \brief |
|
|
|
* Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout |
|
|
|
*/ |
|
|
|
typedef struct Vec_uint8 { |
|
|
|
/** <No documentation available> */ |
|
|
|
uint8_t * ptr; |
|
|
|
|
|
|
|
/** <No documentation available> */ |
|
|
|
size_t len; |
|
|
|
|
|
|
|
/** <No documentation available> */ |
|
|
|
size_t cap; |
|
|
|
} Vec_uint8_t; |
|
|
|
|
|
|
|
/** <No documentation available> */ |
|
|
|
typedef struct DoraResult { |
|
|
|
/** <No documentation available> */ |
|
|
|
Vec_uint8_t error; |
|
|
|
} DoraResult_t; |
|
|
|
|
|
|
|
/** <No documentation available> */ |
|
|
|
typedef struct DoraDropOperator { |
|
|
|
/** <No documentation available> */ |
|
|
|
DoraResult_t (*drop_operator)(void *); |
|
|
|
} DoraDropOperator_t; |
|
|
|
|
|
|
|
/** <No documentation available> */ |
|
|
|
typedef struct InitResult { |
|
|
|
/** <No documentation available> */ |
|
|
|
DoraResult_t result; |
|
|
|
|
|
|
|
/** <No documentation available> */ |
|
|
|
void * operator_context; |
|
|
|
} InitResult_t; |
|
|
|
|
|
|
|
/** <No documentation available> */ |
|
|
|
typedef struct DoraInitOperator { |
|
|
|
/** <No documentation available> */ |
|
|
|
InitResult_t (*init_operator)(void); |
|
|
|
} DoraInitOperator_t; |
|
|
|
|
|
|
|
/** <No documentation available> */ |
|
|
|
/** \remark Has the same ABI as `uint8_t` **/ |
|
|
|
#ifdef DOXYGEN |
|
|
|
typedef |
|
|
|
#endif |
|
|
|
enum DoraStatus { |
|
|
|
/** <No documentation available> */ |
|
|
|
DORA_STATUS_CONTINUE = 0, |
|
|
|
/** <No documentation available> */ |
|
|
|
DORA_STATUS_STOP = 1, |
|
|
|
} |
|
|
|
#ifndef DOXYGEN |
|
|
|
; typedef uint8_t |
|
|
|
#endif |
|
|
|
DoraStatus_t; |
|
|
|
|
|
|
|
/** <No documentation available> */ |
|
|
|
typedef struct OnInputResult { |
|
|
|
/** <No documentation available> */ |
|
|
|
DoraResult_t result; |
|
|
|
|
|
|
|
/** <No documentation available> */ |
|
|
|
DoraStatus_t status; |
|
|
|
} OnInputResult_t; |
|
|
|
|
|
|
|
/** <No documentation available> */ |
|
|
|
typedef struct Metadata { |
|
|
|
/** <No documentation available> */ |
|
|
|
Vec_uint8_t open_telemetry_context; |
|
|
|
} Metadata_t; |
|
|
|
|
|
|
|
/** <No documentation available> */ |
|
|
|
typedef struct Input { |
|
|
|
/** <No documentation available> */ |
|
|
|
Vec_uint8_t id; |
|
|
|
|
|
|
|
/** <No documentation available> */ |
|
|
|
Vec_uint8_t data; |
|
|
|
|
|
|
|
/** <No documentation available> */ |
|
|
|
Metadata_t metadata; |
|
|
|
} Input_t; |
|
|
|
|
|
|
|
/** <No documentation available> */ |
|
|
|
typedef struct Output { |
|
|
|
/** <No documentation available> */ |
|
|
|
Vec_uint8_t id; |
|
|
|
|
|
|
|
/** <No documentation available> */ |
|
|
|
Vec_uint8_t data; |
|
|
|
|
|
|
|
/** <No documentation available> */ |
|
|
|
Metadata_t metadata; |
|
|
|
} Output_t; |
|
|
|
|
|
|
|
/** \brief |
|
|
|
* `Arc<dyn Send + Sync + Fn(A1) -> Ret>` |
|
|
|
*/ |
|
|
|
typedef struct ArcDynFn1_DoraResult_Output { |
|
|
|
/** <No documentation available> */ |
|
|
|
void * env_ptr; |
|
|
|
|
|
|
|
/** <No documentation available> */ |
|
|
|
DoraResult_t (*call)(void *, Output_t); |
|
|
|
|
|
|
|
/** <No documentation available> */ |
|
|
|
void (*release)(void *); |
|
|
|
|
|
|
|
/** <No documentation available> */ |
|
|
|
void (*retain)(void *); |
|
|
|
} ArcDynFn1_DoraResult_Output_t; |
|
|
|
|
|
|
|
/** <No documentation available> */ |
|
|
|
typedef struct SendOutput { |
|
|
|
/** <No documentation available> */ |
|
|
|
ArcDynFn1_DoraResult_Output_t send_output; |
|
|
|
} SendOutput_t; |
|
|
|
|
|
|
|
/** <No documentation available> */ |
|
|
|
typedef struct DoraOnInput { |
|
|
|
/** <No documentation available> */ |
|
|
|
OnInputResult_t (*on_input)(Input_t const *, SendOutput_t, void *); |
|
|
|
} DoraOnInput_t; |
|
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus |
|
|
|
} /* extern \"C\" */ |
|
|
|
#endif |
|
|
|
|
|
|
|
int dora_init_operator(void **operator_context); |
|
|
|
|
|
|
|
void dora_drop_operator(void *operator_context); |
|
|
|
|
|
|
|
int dora_on_input( |
|
|
|
const char *id_start, |
|
|
|
size_t id_len, |
|
|
|
const char *data_start, |
|
|
|
size_t data_len, |
|
|
|
const int (*output_fn_raw)(const char *id_start, |
|
|
|
size_t id_len, |
|
|
|
const char *data_start, |
|
|
|
size_t data_len, |
|
|
|
const void *output_context), |
|
|
|
void *output_context, |
|
|
|
const void *operator_context); |
|
|
|
#endif /* __RUST_DORA_OPERATOR_API_C__ */ |