pub trait CombsEngineCore: Send + Sync {
// Required methods
fn init(&self, key: &[u8]) -> Result<(), EngineError>;
fn infer(&self, prompt: &str) -> Result<String, EngineError>;
fn encrypt_memory(&self, data: &[u8]) -> Result<Vec<u8>, EngineError>;
fn decrypt_memory(&self, data: &[u8]) -> Result<Vec<u8>, EngineError>;
fn render_sprite(
&self,
emoji: &Emoji,
frame_index: u32,
) -> Result<Vec<u8>, EngineError>;
fn shutdown(&self) -> Result<(), EngineError>;
}Expand description
The engine contract surfaced over the C ABI.
Required Methods§
Sourcefn init(&self, key: &[u8]) -> Result<(), EngineError>
fn init(&self, key: &[u8]) -> Result<(), EngineError>
Initializes the engine with a master key (HKDF input).
Sourcefn infer(&self, prompt: &str) -> Result<String, EngineError>
fn infer(&self, prompt: &str) -> Result<String, EngineError>
Runs inference on prompt. Requires the engine feature.
Sourcefn encrypt_memory(&self, data: &[u8]) -> Result<Vec<u8>, EngineError>
fn encrypt_memory(&self, data: &[u8]) -> Result<Vec<u8>, EngineError>
Encrypts a memory blob (nonce-prefixed AEAD).
Sourcefn decrypt_memory(&self, data: &[u8]) -> Result<Vec<u8>, EngineError>
fn decrypt_memory(&self, data: &[u8]) -> Result<Vec<u8>, EngineError>
Decrypts a blob produced by CombsEngineCore::encrypt_memory.
Sourcefn render_sprite(
&self,
emoji: &Emoji,
frame_index: u32,
) -> Result<Vec<u8>, EngineError>
fn render_sprite( &self, emoji: &Emoji, frame_index: u32, ) -> Result<Vec<u8>, EngineError>
Renders frame frame_index of the emoji’s first sprite atlas to
RGBA8 bytes.
Sourcefn shutdown(&self) -> Result<(), EngineError>
fn shutdown(&self) -> Result<(), EngineError>
Shuts the engine down, zeroizing key material.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".