pub struct Bool { /* private fields */ }Expand description
The Objective-C BOOL type.
The type of BOOL varies across platforms, so we expose this wrapper. It
is intended that you convert this into a Rust bool with the
Bool::as_bool method as soon as possible.
This is FFI-safe and can be used directly with msg_send! and extern
functions as a substitute for BOOL in Objective-C. If your Objective-C
code uses C99 _Bool, you should use a #[repr(transparent)] wrapper
around bool instead.
Note that this is able to contain more states than bool on some
platforms, but these cases should not be relied on! The comparison traits
PartialEq, PartialOrd etc. will completely ignore these states.
See also the corresponding documentation entry.
Implementations§
Source§impl Bool
impl Bool
Sourcepub const fn from_raw(value: bool) -> Self
pub const fn from_raw(value: bool) -> Self
Creates this from a raw boolean value.
Avoid this, and instead use Bool in the raw FFI signature.
Sourcepub const fn as_raw(self) -> bool
pub const fn as_raw(self) -> bool
Retrieves the inner boolean type.
Avoid this, and instead use Bool in the raw FFI signature.