#![allow(clippy::unused_self)]
use crate::ffi::example_manual as ffi;
use crate::Error;
use crate::ErrorCode;
pub struct Example {}
impl Example {
pub fn is_ready(&self, name: &str, max: u32) -> Result<ffi::IsReady, Error> {
let mut is_ready = ffi::IsReady {
is_ready: false,
size: 0,
_pad: Default::default(),
};
let state = ffi::State::SomeStateX;
let error_code = unsafe {
ffi::example__is_ready(
name.as_ptr(),
name.len() as u32,
max,
state as u32,
&mut is_ready,
)
};
if error_code != ErrorCode::Success {
return Err(Error::from(error_code));
}
Ok(is_ready)
}
}