Skip to main content

CombsEngineCore

Trait CombsEngineCore 

Source
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§

Source

fn init(&self, key: &[u8]) -> Result<(), EngineError>

Initializes the engine with a master key (HKDF input).

Source

fn infer(&self, prompt: &str) -> Result<String, EngineError>

Runs inference on prompt. Requires the engine feature.

Source

fn encrypt_memory(&self, data: &[u8]) -> Result<Vec<u8>, EngineError>

Encrypts a memory blob (nonce-prefixed AEAD).

Source

fn decrypt_memory(&self, data: &[u8]) -> Result<Vec<u8>, EngineError>

Decrypts a blob produced by CombsEngineCore::encrypt_memory.

Source

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.

Source

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".

Implementors§