#[repr(transparent)]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.
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 YES: Bool = Self::from_raw(objc_sys::YES)
pub const YES: Bool = Self::from_raw(objc_sys::YES)
The equivalent of true
for Objective-C’s BOOL
type.
sourcepub const NO: Bool = Self::from_raw(objc_sys::NO)
pub const NO: Bool = Self::from_raw(objc_sys::NO)
The equivalent of false
for Objective-C’s BOOL
type.
sourcepub const fn from_raw(value: bool) -> Bool
pub const fn from_raw(value: bool) -> Bool
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 objc_sys::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 = Encoding::Pointer(&Self::ENCODING)
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING)
The Objective-C type-encoding for a reference of this type. Read more
impl Copy for Bool
Auto Trait Implementations§
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