impl Pack { /// Value is packed in the `width` least-significant bits. pub(crate) constfn least_significant(width: u32) -> Pack { let mask = mask_for(width);
Pack { mask, shift: 0 }
}
/// Value is packed in the `width` more-significant bits. pub(crate) constfn then(&self, width: u32) -> Pack { let shift = pointer_width() - self.mask.leading_zeros(); let mask = mask_for(width) << shift;
Pack { mask, shift }
}
/// Width, in bits, dedicated to storing the value. pub(crate) constfn width(&self) -> u32 {
pointer_width() - (self.mask >> self.shift).leading_zeros()
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.