#[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

The equivalent of true for Objective-C’s BOOL type.

The equivalent of false for Objective-C’s BOOL type.

Creates an Objective-C boolean from a Rust boolean.

Creates this from a boolean value received from a raw Objective-C API.

Retrieves the inner objc_sys::BOOL boolean type, to be used in raw Objective-C APIs.

Returns true if self is NO.

You should prefer using as_bool.

Returns true if self is not NO.

You should prefer using as_bool.

Converts this into the bool equivalent.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

The Objective-C type-encoding for this type.

Converts to this type from the input type.

The Objective-C type-encoding for a reference of this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.