pub struct RulePos {
pub rule: u32,
pub index: u32,
}Expand description
A cursor into the compiled rule table: rules[rule][index].
Ordering is (rule, index) lexicographic, which stands in for
llama.cpp’s pointer comparison in llama_grammar_advance_stack’s
seen set. Any total order does the job there; only distinctness
matters.
Fields§
§rule: u32§index: u32Implementations§
Trait Implementations§
impl Copy for RulePos
impl Eq for RulePos
Source§impl Ord for RulePos
impl Ord for RulePos
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for RulePos
impl PartialOrd for RulePos
impl StructuralPartialEq for RulePos
Auto Trait Implementations§
impl Freeze for RulePos
impl RefUnwindSafe for RulePos
impl Send for RulePos
impl Sync for RulePos
impl Unpin for RulePos
impl UnsafeUnpin for RulePos
impl UnwindSafe for RulePos
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more