Skip to content

Functions

Module-level functions of sandbox_core.

greet

pub fn greet(name: &str) -> String

Return a friendly greeting for name.

stats

pub fn stats(values: &[f64]) -> Result<Stats, CoreError>

Compute count/min/max/mean over values.

Returns [CoreError::EmptyInput] if values is empty.

scale

pub fn scale(values: &[f64], factor: f64) -> Vec<f64>

Multiply every element of values by factor, returning a new vector.

pack_f32

pub fn pack_f32(values: &[f32]) -> Vec<u8>

Little-endian f32 byte packing (mirrors the kernel's packing shapes).

unpack_f32

pub fn unpack_f32(bytes: &[u8]) -> Result<Vec<f32>, CoreError>

Unpack little-endian f32 bytes back into a vector of floats.

Returns [CoreError::EmptyInput] if the byte length is not a multiple of 4.