pub struct ConstraintState { /* private fields */ }Implementations§
Source§impl ConstraintState
impl ConstraintState
Sourcepub fn commit_token(&mut self, token_id: u32) -> bool
pub fn commit_token(&mut self, token_id: u32) -> bool
Advances the state by the token. If it isn’t allowed, returns false and terminates the state.
Sourcepub fn commit_bytes(&mut self, bytes: &[u8]) -> bool
pub fn commit_bytes(&mut self, bytes: &[u8]) -> bool
Advances the state by the bytes. If they aren’t allowed, returns false and terminates the state.
Source§impl ConstraintState
impl ConstraintState
Source§impl ConstraintState
impl ConstraintState
Sourcepub fn forced_bytes(&self) -> Vec<u8> ⓘ
pub fn forced_bytes(&self) -> Vec<u8> ⓘ
The bytes that must come next.
Sourcepub fn is_accepting(&self) -> bool
pub fn is_accepting(&self) -> bool
Whether the output so far could end here.
Sourcepub fn is_terminated(&self) -> bool
pub fn is_terminated(&self) -> bool
Whether nothing more can be committed.
Trait Implementations§
Source§impl Clone for ConstraintState
impl Clone for ConstraintState
Auto Trait Implementations§
impl !Freeze for ConstraintState
impl !RefUnwindSafe for ConstraintState
impl Send for ConstraintState
impl Sync for ConstraintState
impl Unpin for ConstraintState
impl UnsafeUnpin for ConstraintState
impl !UnwindSafe for ConstraintState
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