INNER CODE UNIT · Rust
new
SitinCloud/Owlyshield · owlyshield_predict/moonfire-tflite/src/lib.rs:121
pub fn new() -> Self {
Self {
options: ptr::NonNull::new(unsafe { TfLiteInterpreterOptionsCreate() }).unwrap(),
owned_delegates: Vec::new(),
_delegate_refs: PhantomData,
}
}
pub fn add_borrowed_delegate(&mut self, d: &'a Delegate) {
unsafe { TfLiteInterpreterOptionsAddDelegate(self.options.as_ptr(), d.delegate.as_ptr()) }
}
pub fn add_owned_delegate(&mut self, d: Delegate) {
unsafe { TfLiteInterpreterOptionsAddDelegate(self.options.as_ptr(), d.delegate.as_ptr()) }
self.owned_delegates.push(d);
}
pub fn build(