pub struct Bool { /* private fields */ }
Expand description
The Objective-C BOOL
type.
This is a thin wrapper-type over objc_sys::BOOL
. 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!
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 boolean value received from a raw Objective-C API.
sourcepub const fn as_raw(self) -> BOOL
pub const fn as_raw(self) -> BOOL
Retrieves the inner ffi::BOOL
boolean type, to be used in raw
Objective-C APIs.
Trait Implementations§
source§impl RefEncode for Bool
impl RefEncode for Bool
source§const ENCODING_REF: Encoding = _
const ENCODING_REF: Encoding = _
The Objective-C type-encoding for a reference of this type. Read more
impl Copy for Bool
Auto Trait Implementations§
impl Freeze for Bool
impl RefUnwindSafe for Bool
impl Send for Bool
impl Sync for Bool
impl Unpin for Bool
impl UnwindSafe for Bool
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> EncodeArgument for Twhere
T: Encode,
impl<T> EncodeArgument for Twhere
T: Encode,
source§const ENCODING_ARGUMENT: Encoding = const ENCODING_ARGUMENT: Encoding = T::ENCODING;
const ENCODING_ARGUMENT: Encoding = const ENCODING_ARGUMENT: Encoding = T::ENCODING;
The Objective-C type-encoding for this type.
source§impl<T> EncodeReturn for Twhere
T: Encode,
impl<T> EncodeReturn for Twhere
T: Encode,
source§const ENCODING_RETURN: Encoding = const ENCODING_RETURN: Encoding = T::ENCODING;
const ENCODING_RETURN: Encoding = const ENCODING_RETURN: Encoding = T::ENCODING;
The Objective-C type-encoding for this type.