Skip to main content

NgramError

Type Alias NgramError 

Source
pub type NgramError = ShimError;
Expand description

Errors from the n-gram drafters.

Aliased Type§

pub enum NgramError {
    Nul(NulError),
    InvalidArg,
    BadJson(String),
    Failed(String),
    Init(String),
    Utf8(FromUtf8Error),
    CorruptResult,
}

Variants§

§

Nul(NulError)

An argument contained an interior NUL byte, so it could not become a CString. Caught in Rust — truncating at the NUL would silently change the value.

§

InvalidArg

A required pointer argument was null, or a value was out of range.

§

BadJson(String)

Input was not valid JSON.

§

Failed(String)

llama.cpp threw. The message is what the exception carried.

§

Init(String)

A constructor returned null.

§

Utf8(FromUtf8Error)

Output was not valid UTF-8.

§

CorruptResult

A shim reported an offset outside the buffer it described, which would mean the shim and this crate disagree about the layout.