pub enum SamplerInitError {
InteriorNul {
field: &'static str,
source: NulError,
},
NullReturn(&'static str),
}Expand description
Why a sampler could not be constructed.
The panicking constructors — LlamaSampler::grammar and friends — are
kept for the common case where the grammar is a literal or came from
ChatParams::grammar, and a failure really is a
bug. These exist for the case they handle badly: a grammar, rule name or
trigger pattern that arrived from a request, where an interior NUL is bad
input rather than a broken invariant.
Variants§
InteriorNul
A caller-supplied string contained an interior NUL, so it cannot cross
the FFI boundary. field names which argument.
Fields
NullReturn(&'static str)
llama.cpp returned null. For a grammar sampler this is what an unparseable GBNF grammar looks like; it logs the parse error itself.
Trait Implementations§
Source§impl Debug for SamplerInitError
impl Debug for SamplerInitError
Source§impl Display for SamplerInitError
impl Display for SamplerInitError
impl Eq for SamplerInitError
Source§impl Error for SamplerInitError
impl Error for SamplerInitError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for SamplerInitError
impl PartialEq for SamplerInitError
impl StructuralPartialEq for SamplerInitError
Auto Trait Implementations§
impl Freeze for SamplerInitError
impl RefUnwindSafe for SamplerInitError
impl Send for SamplerInitError
impl Sync for SamplerInitError
impl Unpin for SamplerInitError
impl UnsafeUnpin for SamplerInitError
impl UnwindSafe for SamplerInitError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more