/// A 32-bit value representing boolean values and returned by some functions to indicate success or failure. #[must_use] #[repr(transparent)] #[derive(Clone, Copy, Debug, PartialEq, Eq, Default)] pubstruct BOOL(pub i32);
impl BOOL { /// Converts the [`BOOL`] to a [`prim@bool`] value. #[inline] pubfn as_bool(self) -> bool { self.0 != 0
}
/// Asserts that `self` is a success code. #[inline] #[track_caller] pubfn unwrap(self) { self.ok().unwrap();
}
/// Asserts that `self` is a success code using the given panic message. #[inline] #[track_caller] pubfn expect(self, msg: &str) { self.ok().expect(msg);
}
}
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.