mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
pvimg: Unignore a Rust doctest
While at it, improve it. Reviewed-by: Steffen Eiden <seiden@linux.ibm.com> Signed-off-by: Marc Hartmayer <marc@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
68fe816da9
commit
e557f41c6e
@@ -186,14 +186,18 @@ pub trait ControlFlagsTrait {
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```rust,ignore
|
||||
/// use flags::{ControlFlagTrait, ControlFlags, PcfV1};
|
||||
/// ```rust
|
||||
/// use pvimg::uvdata::{ControlFlagsTrait, PcfV1, PlaintextControlFlagsV1};
|
||||
///
|
||||
/// // Create from u64
|
||||
/// let flags: ControlFlags<PcfV1> = 0x0000000020000000_u64.into();
|
||||
/// // Create from u64 (bit 57 MSB0 = 0x40)
|
||||
/// let flags: PlaintextControlFlagsV1 = 0x0000000000000040_u64.into();
|
||||
///
|
||||
/// // Check if a flag is set
|
||||
/// assert!(flags.is_set(PcfV1::PckmoAes));
|
||||
///
|
||||
/// // Convert back to u64
|
||||
/// let value: u64 = flags.into();
|
||||
/// assert_eq!(value, 0x0000000000000040_u64);
|
||||
/// ```
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
pub struct ControlFlags<T: ControlFlagTrait> {
|
||||
|
||||
Reference in New Issue
Block a user