pub enum Composition {
Single(Shift),
Zero,
Pair,
}Expand description
What the composition of two shifts denotes.
Composing two shifts does not always need two: they may collapse to one shift, or clear the word outright. A caller merging shifts has to tell those apart — the collapsed cases save a shift slot, and the cleared case means the term contributes nothing and should be dropped rather than encoded.
Variants§
Single(Shift)
The two collapse to this single shift, which may be Shift::IDENTITY.
Zero
The two clear every bit, so the term they apply to is zero.
Pair
The two do not collapse; both are needed, in the order they were given.
Trait Implementations§
Source§impl Clone for Composition
impl Clone for Composition
Source§fn clone(&self) -> Composition
fn clone(&self) -> Composition
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 Composition
impl Debug for Composition
Source§impl Hash for Composition
impl Hash for Composition
Source§impl PartialEq for Composition
impl PartialEq for Composition
Source§fn eq(&self, other: &Composition) -> bool
fn eq(&self, other: &Composition) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for Composition
impl Eq for Composition
impl StructuralPartialEq for Composition
Auto Trait Implementations§
impl Freeze for Composition
impl RefUnwindSafe for Composition
impl Send for Composition
impl Sync for Composition
impl Unpin for Composition
impl UnsafeUnpin for Composition
impl UnwindSafe for Composition
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