Struct objc2_foundation::NSHashTable
source · #[repr(C)]pub struct NSHashTable<ObjectType: ?Sized = AnyObject> { /* private fields */ }
Available on crate feature
NSHashTable
only.Implementations§
source§impl<ObjectType: Message> NSHashTable<ObjectType>
impl<ObjectType: Message> NSHashTable<ObjectType>
pub unsafe fn initWithOptions_capacity( this: Allocated<Self>, options: NSPointerFunctionsOptions, initial_capacity: NSUInteger ) -> Retained<Self>
Available on crate feature
NSPointerFunctions
only.pub unsafe fn initWithPointerFunctions_capacity( this: Allocated<Self>, functions: &NSPointerFunctions, initial_capacity: NSUInteger ) -> Retained<Self>
Available on crate feature
NSPointerFunctions
only.pub unsafe fn hashTableWithOptions( options: NSPointerFunctionsOptions ) -> Retained<NSHashTable<ObjectType>>
Available on crate feature
NSPointerFunctions
only.pub unsafe fn hashTableWithWeakObjects() -> Retained<AnyObject>
👎Deprecated: GC no longer supported
pub unsafe fn weakObjectsHashTable() -> Retained<NSHashTable<ObjectType>>
pub unsafe fn pointerFunctions(&self) -> Retained<NSPointerFunctions>
Available on crate feature
NSPointerFunctions
only.pub unsafe fn count(&self) -> NSUInteger
pub unsafe fn member( &self, object: Option<&ObjectType> ) -> Option<Retained<ObjectType>>
pub unsafe fn objectEnumerator(&self) -> Retained<NSEnumerator<ObjectType>>
Available on crate feature
NSEnumerator
only.pub unsafe fn addObject(&self, object: Option<&ObjectType>)
pub unsafe fn removeObject(&self, object: Option<&ObjectType>)
pub unsafe fn removeAllObjects(&self)
pub unsafe fn allObjects(&self) -> Retained<NSArray<ObjectType>>
Available on crate feature
NSArray
only.pub unsafe fn anyObject(&self) -> Option<Retained<ObjectType>>
pub unsafe fn containsObject(&self, an_object: Option<&ObjectType>) -> bool
pub unsafe fn intersectsHashTable( &self, other: &NSHashTable<ObjectType> ) -> bool
pub unsafe fn isEqualToHashTable(&self, other: &NSHashTable<ObjectType>) -> bool
pub unsafe fn isSubsetOfHashTable( &self, other: &NSHashTable<ObjectType> ) -> bool
pub unsafe fn intersectHashTable(&self, other: &NSHashTable<ObjectType>)
pub unsafe fn unionHashTable(&self, other: &NSHashTable<ObjectType>)
pub unsafe fn minusHashTable(&self, other: &NSHashTable<ObjectType>)
pub unsafe fn setRepresentation(&self) -> Retained<NSSet<ObjectType>>
Available on crate feature
NSSet
only.Methods from Deref<Target = NSObject>§
sourcepub fn doesNotRecognizeSelector(&self, sel: Sel) -> !
pub fn doesNotRecognizeSelector(&self, sel: Sel) -> !
Handle messages the object doesn’t recognize.
See Apple’s documentation for details.
Methods from Deref<Target = AnyObject>§
sourcepub fn class(&self) -> &'static AnyClass
pub fn class(&self) -> &'static AnyClass
Dynamically find the class of this object.
§Example
Check that an instance of NSObject
has the precise class NSObject
.
use objc2::ClassType;
use objc2::runtime::NSObject;
let obj = NSObject::new();
assert_eq!(obj.class(), NSObject::class());
sourcepub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
👎Deprecated: this is difficult to use correctly, use Ivar::load
instead.
pub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
Ivar::load
instead.Use Ivar::load
instead.
§Safety
The object must have an instance variable with the given name, and it
must be of type T
.
See Ivar::load_ptr
for details surrounding this.
sourcepub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
👎Deprecated: this is difficult to use correctly, use Ivar::load_mut
instead.
pub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
Ivar::load_mut
instead.Use Ivar::load_mut
instead.
§Safety
The object must have an instance variable with the given name, and it
must be of type T
.
See Ivar::load_ptr
for details surrounding this.
Trait Implementations§
source§impl<ObjectType: ?Sized + Message> AsMut<NSHashTable<ObjectType>> for NSHashTable<ObjectType>
impl<ObjectType: ?Sized + Message> AsMut<NSHashTable<ObjectType>> for NSHashTable<ObjectType>
source§impl<ObjectType: ?Sized + Message> AsRef<NSHashTable<ObjectType>> for NSHashTable<ObjectType>
impl<ObjectType: ?Sized + Message> AsRef<NSHashTable<ObjectType>> for NSHashTable<ObjectType>
source§impl<ObjectType: ?Sized + Message> BorrowMut<AnyObject> for NSHashTable<ObjectType>
impl<ObjectType: ?Sized + Message> BorrowMut<AnyObject> for NSHashTable<ObjectType>
source§fn borrow_mut(&mut self) -> &mut AnyObject
fn borrow_mut(&mut self) -> &mut AnyObject
Mutably borrows from an owned value. Read more
source§impl<ObjectType: ?Sized + Message> BorrowMut<NSObject> for NSHashTable<ObjectType>
impl<ObjectType: ?Sized + Message> BorrowMut<NSObject> for NSHashTable<ObjectType>
source§fn borrow_mut(&mut self) -> &mut NSObject
fn borrow_mut(&mut self) -> &mut NSObject
Mutably borrows from an owned value. Read more
source§impl<ObjectType: ?Sized + Message> ClassType for NSHashTable<ObjectType>
impl<ObjectType: ?Sized + Message> ClassType for NSHashTable<ObjectType>
§type Mutability = InteriorMutable
type Mutability = InteriorMutable
Whether the type is mutable or immutable. Read more
source§const NAME: &'static str = "NSHashTable"
const NAME: &'static str = "NSHashTable"
The name of the Objective-C class that this type represents. Read more
source§fn class() -> &'static AnyClass
fn class() -> &'static AnyClass
Get a reference to the Objective-C class that this type represents. Read more
source§fn as_super_mut(&mut self) -> &mut Self::Super
fn as_super_mut(&mut self) -> &mut Self::Super
Get a mutable reference to the superclass.
source§impl<ObjectType: PartialEq + ?Sized> PartialEq for NSHashTable<ObjectType>
impl<ObjectType: PartialEq + ?Sized> PartialEq for NSHashTable<ObjectType>
source§fn eq(&self, other: &NSHashTable<ObjectType>) -> bool
fn eq(&self, other: &NSHashTable<ObjectType>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<ObjectType: ?Sized + Message> RefEncode for NSHashTable<ObjectType>
impl<ObjectType: ?Sized + Message> RefEncode for NSHashTable<ObjectType>
source§const ENCODING_REF: Encoding = <NSObject as ::objc2::RefEncode>::ENCODING_REF
const ENCODING_REF: Encoding = <NSObject as ::objc2::RefEncode>::ENCODING_REF
The Objective-C type-encoding for a reference of this type. Read more
impl<ObjectType: Eq + ?Sized> Eq for NSHashTable<ObjectType>
impl<ObjectType: ?Sized + Message> Message for NSHashTable<ObjectType>
impl<ObjectType: ?Sized + NSCoding> NSCoding for NSHashTable<ObjectType>
Available on crate feature
NSObject
only.impl<ObjectType: ?Sized + IsIdCloneable> NSCopying for NSHashTable<ObjectType>
Available on crate feature
NSObject
only.impl<ObjectType: ?Sized> NSFastEnumeration for NSHashTable<ObjectType>
Available on crate feature
NSEnumerator
only.impl<ObjectType: ?Sized> NSObjectProtocol for NSHashTable<ObjectType>
impl<ObjectType: ?Sized + NSSecureCoding> NSSecureCoding for NSHashTable<ObjectType>
Available on crate feature
NSObject
only.impl<ObjectType: ?Sized> StructuralPartialEq for NSHashTable<ObjectType>
Auto Trait Implementations§
impl<ObjectType = AnyObject> !Freeze for NSHashTable<ObjectType>
impl<ObjectType = AnyObject> !RefUnwindSafe for NSHashTable<ObjectType>
impl<ObjectType = AnyObject> !Send for NSHashTable<ObjectType>
impl<ObjectType = AnyObject> !Sync for NSHashTable<ObjectType>
impl<ObjectType = AnyObject> !Unpin for NSHashTable<ObjectType>
impl<ObjectType = AnyObject> !UnwindSafe for NSHashTable<ObjectType>
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