MCPcopy Create free account
hub / github.com/bamler-lab/constriction / is_empty

Method is_empty

src/stream/stack.rs:415–421  ·  view source on GitHub ↗

Check if no data for decoding is left. Note that you can still pop symbols off an empty stack, but this is only useful in rare edge cases, see documentation of [`decode_symbol`](#method.decode_symbol).

(&self)

Source from the content-addressed store, hash-verified

413 /// useful in rare edge cases, see documentation of
414 /// [`decode_symbol`](#method.decode_symbol).
415 pub fn is_empty(&self) -> bool {
416 // We don't need to check if `bulk` is empty (which would require an additional
417 // type bound `Backend: ReadLookaheadItems<Word>` because we keep up the
418 // invariant that `state >= State::one() << (State::BITS - Word::BITS))`
419 // when `bulk` is not empty.
420 self.state == State::zero()
421 }
422
423 /// Assembles the current compressed data into a single slice.
424 ///

Callers 8

test_old_module_example1Function · 0.95
test_stack2Function · 0.95
test_ans_exampleFunction · 0.95
test_stack_gaussianFunction · 0.95
test_old_module_example1Function · 0.95
test_stack2Function · 0.95
test_ans_exampleFunction · 0.95
maybe_exhaustedMethod · 0.45

Calls

no outgoing calls

Tested by 7

test_old_module_example1Function · 0.76
test_stack2Function · 0.76
test_ans_exampleFunction · 0.76
test_stack_gaussianFunction · 0.76
test_old_module_example1Function · 0.76
test_stack2Function · 0.76
test_ans_exampleFunction · 0.76