pub struct Array<T: Obj>(/* private fields */);Expand description
Objective-C NSArray wrapper.
Uses arc::R for retained objects and provides safe convenience helpers for
common operations like iteration and bounds-checked access via get.
Implementations§
Source§impl<T: Obj> Array<T>
NSPredicateSupport
impl<T: Obj> Array<T>
NSPredicateSupport
pub fn filtered_by_predicate_ar(&self, predicate: &Predicate) -> Rar<Self>
pub fn filtered_by_predicate(&self, predicate: &Predicate) -> R<Self>
Source§impl<T: Obj> Array<T>
impl<T: Obj> Array<T>
pub fn cls() -> &'static Class<Self>
pub fn cls_ptr() -> *const c_void
pub fn alloc() -> A<Self>
pub fn empty() -> R<Self>
Sourcepub fn _new() -> R<Self>
pub fn _new() -> R<Self>
Alternate constructor using NS_ARRAY.new().
Prefer new(); this path is slower.
Sourcepub fn from_slice(objs: &[&T]) -> R<Self>
pub fn from_slice(objs: &[&T]) -> R<Self>
Builds an array from borrowed object references.
Sourcepub fn from_slice_retained(objs: &[R<T>]) -> R<Self>
pub fn from_slice_retained(objs: &[R<T>]) -> R<Self>
Builds an array from retained objects.
Sourcepub fn iter(&self) -> FeIterator<'_, Self, T> ⓘ
pub fn iter(&self) -> FeIterator<'_, Self, T> ⓘ
Returns a fast enumeration iterator.
Sourcepub unsafe fn get_throws_ar(&self, index: usize) -> Rar<T>
pub unsafe fn get_throws_ar(&self, index: usize) -> Rar<T>
Sourcepub unsafe fn get_throws(&self, index: usize) -> R<T>
pub unsafe fn get_throws(&self, index: usize) -> R<T>
Sourcepub fn get<'ear>(&self, index: usize) -> ExResult<'ear, R<T>>
pub fn get<'ear>(&self, index: usize) -> ExResult<'ear, R<T>>
Returns the object at index, capturing ObjC exceptions as ExResult.
pub fn as_cf(&self) -> &ArrayOf<T>
pub fn as_cf_mut(&mut self) -> &mut ArrayOf<T>
Source§impl<T: Obj> Array<T>
NSArrayDiffing
impl<T: Obj> Array<T>
NSArrayDiffing
pub fn diff_from_array_using_eq_test_block_ar( &self, other: &Array<T>, options: OrderedCollectionDiffCalcOpts, block: &mut NoEscBlock<fn(&T, &T) -> bool>, ) -> Rar<OrderedCollectionDiff<T>>
pub fn diff_from_array_using_eq_test_block( &self, other: &Array<T>, options: OrderedCollectionDiffCalcOpts, block: &mut NoEscBlock<fn(&T, &T) -> bool>, ) -> R<OrderedCollectionDiff<T>>
pub fn diff_from_array_using_eq_test( &self, other: &Array<T>, options: OrderedCollectionDiffCalcOpts, block: impl FnMut(&T, &T) -> bool, ) -> R<OrderedCollectionDiff<T>>
pub fn diff_from_array_opts_ar( &self, other: &Array<T>, options: OrderedCollectionDiffCalcOpts, ) -> Rar<OrderedCollectionDiff<T>>
pub fn diff_from_array_opts( &self, other: &Array<T>, options: OrderedCollectionDiffCalcOpts, ) -> R<OrderedCollectionDiff<T>>
pub fn diff_from_array_ar( &self, other: &Array<T>, ) -> Rar<OrderedCollectionDiff<T>>
pub fn diff_from_array(&self, other: &Array<T>) -> R<OrderedCollectionDiff<T>>
pub fn array_by_applying_diff_ar( &self, diff: &OrderedCollectionDiff<T>, ) -> Option<Rar<Self>>
pub fn array_by_applying_diff( &self, diff: &OrderedCollectionDiff<T>, ) -> Option<R<Self>>
Methods from Deref<Target = Id>§
pub unsafe fn value_for_key_throws_ar(&self, key: &String) -> Option<Rar<Self>>
pub unsafe fn value_for_key_throws(&self, key: &String) -> Option<R<Self>>
pub fn value_for_key<'ear>( &self, key: &String, ) -> ExResult<'ear, Option<R<Self>>>
pub unsafe fn value_for_key_path_throws_ar( &self, key_path: &String, ) -> Option<Rar<Self>>
pub unsafe fn value_for_key_path_throws( &self, key_path: &String, ) -> Option<R<Self>>
pub fn value_for_key_path<'ear>( &self, key_path: &String, ) -> ExResult<'ear, Option<R<Self>>>
pub fn as_type_ref(&self) -> &Type
pub fn as_id_ref(&self) -> &Self
pub fn is_equal(&self, other: &Self) -> bool
pub fn hash(&self) -> UInteger
pub fn as_ptr(&self) -> *const Self
Trait Implementations§
Source§impl<T> Obj for Array<T>where
T: Obj,
impl<T> Obj for Array<T>where
T: Obj,
unsafe fn retain(id: &Self) -> R<Self>
unsafe fn release(id: &mut Self)
fn desc_ar(&self) -> Rar<String>
fn desc(&self) -> R<String>
fn debug_desc_ar(&self) -> Rar<String>
fn debug_desc(&self) -> R<String>
fn responds_to_sel(&self, sel: &Sel) -> bool
fn class(&self) -> &Class<Self>
fn is_kind_of_class<T: Obj>(&self, cls: &Class<T>) -> bool
fn try_cast<T: Obj>(&self, cls: &Class<T>) -> Option<&T>
fn try_cast_mut<T: Obj>(&mut self, cls: &Class<T>) -> Option<&mut T>
fn is_member_of_class<T: Obj>(&self, cls: &Class<T>) -> bool
fn is_tagged_ptr(&self) -> bool
fn as_id_ref(&self) -> &Id
impl<T> Send for Array<T>
Auto Trait Implementations§
impl<T> !Sync for Array<T>
impl<T> Freeze for Array<T>
impl<T> RefUnwindSafe for Array<T>where
T: RefUnwindSafe,
impl<T> Unpin for Array<T>where
T: Unpin,
impl<T> UnsafeUnpin for Array<T>
impl<T> UnwindSafe for Array<T>where
T: UnwindSafe,
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