pub struct Sel { /* private fields */ }
Expand description
A method selector.
The Rust equivalent of Objective-C’s SEL
type. You can create this
statically using the sel!
macro.
The main reason the Objective-C runtime uses a custom type for selectors, as opposed to a plain c-string, is to support efficient comparison - a a selector is effectively an interned string, so this makes equiality comparisons very cheap.
This struct guarantees the null-pointer optimization, namely that
Option<Sel>
is the same size as Sel
.
Implementations§
Trait Implementations§
source§impl PartialEq for Sel
impl PartialEq for Sel
impl Copy for Sel
impl Eq for Sel
impl OptionEncode for Sel
impl RefUnwindSafe for Sel
impl Send for Sel
impl Sync for Sel
impl UnwindSafe for Sel
Auto Trait Implementations§
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.