pub struct DenseShiftEncoding { /* private fields */ }Expand description
A dense re-encoding of the shift sequences occurring in a key segment. A key names a sequence of two shifts, each slot drawn from a fixed alphabet of 512 spellings.
- The sequence space is therefore 512^2 = 262,144 entries.
- A constraint system uses only a few dozen of them.
- The segment’s own sequences are re-encoded as a contiguous range.
- A per-sequence table is sized by the sequences present, not the whole space.
- The space is too large for a lookup table, so a sequence is located by binary search.
Implementations§
Source§impl DenseShiftEncoding
impl DenseShiftEncoding
Sourcepub fn iter(&self) -> impl Iterator<Item = [Shift; 2]> + '_
pub fn iter(&self) -> impl Iterator<Item = [Shift; 2]> + '_
The shift sequences the segment uses, in dense index order.
Sourcepub fn shift_indices(&self) -> impl Iterator<Item = usize> + '_
pub fn shift_indices(&self) -> impl Iterator<Item = usize> + '_
Where every sequence the segment uses sits in the space two shift slots span.
- The space is addressed outer-major: the outer slot’s index sits above the inner slot’s.
- This matches the reduction’s round order, which peels the outer shift first.
- Distinct sequences land on distinct indices, so two segments’ encodings can merge.
- The indices do not come out ascending, since sequences are sorted by inner slot first.
- Nothing needs them ascending.
index = (outer_index << LOG_SHIFT_COUNT) | inner_indexTrait Implementations§
Source§impl Clone for DenseShiftEncoding
impl Clone for DenseShiftEncoding
Source§fn clone(&self) -> DenseShiftEncoding
fn clone(&self) -> DenseShiftEncoding
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DenseShiftEncoding
impl Debug for DenseShiftEncoding
Source§impl Default for DenseShiftEncoding
impl Default for DenseShiftEncoding
Source§fn default() -> DenseShiftEncoding
fn default() -> DenseShiftEncoding
Returns the “default value” for a type. Read more
Source§impl DeserializeBytes for DenseShiftEncoding
impl DeserializeBytes for DenseShiftEncoding
fn deserialize(read_buf: impl Buf) -> Result<Self, SerializationError>
Source§impl SerializeBytes for DenseShiftEncoding
impl SerializeBytes for DenseShiftEncoding
Auto Trait Implementations§
impl Freeze for DenseShiftEncoding
impl RefUnwindSafe for DenseShiftEncoding
impl Send for DenseShiftEncoding
impl Sync for DenseShiftEncoding
impl Unpin for DenseShiftEncoding
impl UnsafeUnpin for DenseShiftEncoding
impl UnwindSafe for DenseShiftEncoding
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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