mistralrs::llguidance::ffi

Function llg_compute_mask

pub extern "C" fn llg_compute_mask(
    cc: &mut LlgConstraint,
    res_p: *mut LlgMaskResult,
) -> i32
Expand description

Compute mask for the next token sampling It typically takes up to a millisecond for a 100k tokenizer, so should be called in background. Returns 0 on success and -1 on error (use llg_get_error() to get the exact error). When 0 is returned, the result is written to *res_p.