Struct objc2_foundation::NSMutableArray
source · [−]#[repr(C)]pub struct NSMutableArray<T, O: Ownership> { /* private fields */ }
Implementations
sourceimpl<T: Message, O: Ownership> NSMutableArray<T, O>
impl<T: Message, O: Ownership> NSMutableArray<T, O>
sourceimpl<T: Message> NSMutableArray<T, Shared>
impl<T: Message> NSMutableArray<T, Shared>
sourceimpl<T: Message, O: Ownership> NSMutableArray<T, O>
impl<T: Message, O: Ownership> NSMutableArray<T, O>
pub fn push(&mut self, obj: Id<T, O>)
pub fn insert(&mut self, index: usize, obj: Id<T, O>)
pub fn replace(&mut self, index: usize, obj: Id<T, O>) -> Id<T, O>
pub fn remove(&mut self, index: usize) -> Id<T, O>
pub fn pop(&mut self) -> Option<Id<T, O>>
pub fn clear(&mut self)
pub fn sort_by<F: FnMut(&T, &T) -> Ordering>(&mut self, compare: F)
Methods from Deref<Target = NSArray<T, O>>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn get(&self, index: usize) -> Option<&T>
pub fn first(&self) -> Option<&T>
pub fn last(&self) -> Option<&T>
pub fn iter(&self) -> NSEnumerator<'_, T>ⓘNotable traits for NSEnumerator<'a, T>impl<'a, T: Message> Iterator for NSEnumerator<'a, T> type Item = &'a T;
pub fn objects_in_range(&self, range: Range<usize>) -> Vec<&T>
pub fn to_vec(&self) -> Vec<&T>
pub fn get_retained(&self, index: usize) -> Id<T, Shared>
Methods from Deref<Target = NSObject>
Methods from Deref<Target = Object>
sourcepub unsafe fn ivar<T>(&self, name: &str) -> &T where
T: Encode,
pub unsafe fn ivar<T>(&self, name: &str) -> &T where
T: Encode,
Returns a shared reference to the ivar with the given name.
Panics
Panics if the object has no ivar with the given name, or the type
encoding of the ivar differs from the type encoding of T
.
Safety
The caller must ensure that the ivar is actually of type T
.
Library implementors should expose a safe interface to the ivar.
sourcepub unsafe fn get_ivar<T>(&self, name: &str) -> &T where
T: Encode,
👎 Deprecated: Use Object::ivar
instead.
pub unsafe fn get_ivar<T>(&self, name: &str) -> &T where
T: Encode,
Use Object::ivar
instead.
sourcepub unsafe fn ivar_mut<T>(&mut self, name: &str) -> &mut T where
T: Encode,
pub unsafe fn ivar_mut<T>(&mut self, name: &str) -> &mut T where
T: Encode,
Returns a mutable reference to the ivar with the given name.
Panics
Panics if the object has no ivar with the given name, or the type
encoding of the ivar differs from the type encoding of T
.
Safety
The caller must ensure that the ivar is actually of type T
.
Library implementors should expose a safe interface to the ivar.
sourcepub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut T where
T: Encode,
👎 Deprecated: Use Object::ivar_mut
instead.
pub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut T where
T: Encode,
Use Object::ivar_mut
instead.
sourcepub unsafe fn set_ivar<T>(&mut self, name: &str, value: T) where
T: Encode,
pub unsafe fn set_ivar<T>(&mut self, name: &str, value: T) where
T: Encode,
Sets the value of the ivar with the given name.
Panics
Panics if the object has no ivar with the given name, or the type
encoding of the ivar differs from the type encoding of T
.
Safety
The caller must ensure that the ivar is actually of type T
.
Library implementors should expose a safe interface to the ivar.
Trait Implementations
sourceimpl<T, O: Ownership> AsMut<NSArray<T, O>> for NSMutableArray<T, O>
impl<T, O: Ownership> AsMut<NSArray<T, O>> for NSMutableArray<T, O>
sourceimpl<T, O: Ownership> AsMut<NSMutableArray<T, O>> for NSMutableArray<T, O>
impl<T, O: Ownership> AsMut<NSMutableArray<T, O>> for NSMutableArray<T, O>
sourceimpl<T, O: Ownership> AsMut<NSObject> for NSMutableArray<T, O>
impl<T, O: Ownership> AsMut<NSObject> for NSMutableArray<T, O>
sourceimpl<T, O: Ownership> AsMut<Object> for NSMutableArray<T, O>
impl<T, O: Ownership> AsMut<Object> for NSMutableArray<T, O>
sourceimpl<T, O: Ownership> AsRef<NSArray<T, O>> for NSMutableArray<T, O>
impl<T, O: Ownership> AsRef<NSArray<T, O>> for NSMutableArray<T, O>
sourceimpl<T, O: Ownership> AsRef<NSMutableArray<T, O>> for NSMutableArray<T, O>
impl<T, O: Ownership> AsRef<NSMutableArray<T, O>> for NSMutableArray<T, O>
sourceimpl<T, O: Ownership> AsRef<NSObject> for NSMutableArray<T, O>
impl<T, O: Ownership> AsRef<NSObject> for NSMutableArray<T, O>
sourceimpl<T, O: Ownership> AsRef<Object> for NSMutableArray<T, O>
impl<T, O: Ownership> AsRef<Object> for NSMutableArray<T, O>
sourceimpl<T, O: Ownership> Borrow<NSArray<T, O>> for NSMutableArray<T, O>
impl<T, O: Ownership> Borrow<NSArray<T, O>> for NSMutableArray<T, O>
sourceimpl<T, O: Ownership> Borrow<NSObject> for NSMutableArray<T, O>
impl<T, O: Ownership> Borrow<NSObject> for NSMutableArray<T, O>
sourceimpl<T, O: Ownership> Borrow<Object> for NSMutableArray<T, O>
impl<T, O: Ownership> Borrow<Object> for NSMutableArray<T, O>
sourceimpl<T, O: Ownership> BorrowMut<NSArray<T, O>> for NSMutableArray<T, O>
impl<T, O: Ownership> BorrowMut<NSArray<T, O>> for NSMutableArray<T, O>
sourcefn borrow_mut(&mut self) -> &mut NSArray<T, O>
fn borrow_mut(&mut self) -> &mut NSArray<T, O>
Mutably borrows from an owned value. Read more
sourceimpl<T, O: Ownership> BorrowMut<NSObject> for NSMutableArray<T, O>
impl<T, O: Ownership> BorrowMut<NSObject> for NSMutableArray<T, O>
sourcefn borrow_mut(&mut self) -> &mut NSObject
fn borrow_mut(&mut self) -> &mut NSObject
Mutably borrows from an owned value. Read more
sourceimpl<T, O: Ownership> BorrowMut<Object> for NSMutableArray<T, O>
impl<T, O: Ownership> BorrowMut<Object> for NSMutableArray<T, O>
sourcefn borrow_mut(&mut self) -> &mut Object
fn borrow_mut(&mut self) -> &mut Object
Mutably borrows from an owned value. Read more
sourceimpl<T, O: Ownership> Debug for NSMutableArray<T, O>
impl<T, O: Ownership> Debug for NSMutableArray<T, O>
sourceimpl<T: Message, O: Ownership> DefaultId for NSMutableArray<T, O>
impl<T: Message, O: Ownership> DefaultId for NSMutableArray<T, O>
sourceimpl<T, O: Ownership> Deref for NSMutableArray<T, O>
impl<T, O: Ownership> Deref for NSMutableArray<T, O>
sourceimpl<T, O: Ownership> DerefMut for NSMutableArray<T, O>
impl<T, O: Ownership> DerefMut for NSMutableArray<T, O>
sourceimpl<T: Message> NSCopying for NSMutableArray<T, Shared>
impl<T: Message> NSCopying for NSMutableArray<T, Shared>
sourceimpl<T: Message, O: Ownership> NSFastEnumeration for NSMutableArray<T, O>
impl<T: Message, O: Ownership> NSFastEnumeration for NSMutableArray<T, O>
type Item = T
fn iter_fast(&self) -> NSFastEnumerator<'_, Self>ⓘNotable traits for NSFastEnumerator<'a, C>impl<'a, C: NSFastEnumeration + ?Sized> Iterator for NSFastEnumerator<'a, C> type Item = &'a C::Item;
sourceimpl<T: Message> NSMutableCopying for NSMutableArray<T, Shared>
impl<T: Message> NSMutableCopying for NSMutableArray<T, Shared>
type Output = NSMutableArray<T, Shared>
type Output = NSMutableArray<T, Shared>
TODO
fn mutable_copy(&self) -> Id<Self::Output, Owned>
sourceimpl<T: PartialEq, O: PartialEq + Ownership> PartialEq<NSMutableArray<T, O>> for NSMutableArray<T, O>
impl<T: PartialEq, O: PartialEq + Ownership> PartialEq<NSMutableArray<T, O>> for NSMutableArray<T, O>
sourceimpl<T, O: Ownership> RefEncode for NSMutableArray<T, O>
impl<T, O: Ownership> RefEncode for NSMutableArray<T, O>
sourceconst ENCODING_REF: Encoding<'static> = ::objc2::Encoding::Object
const ENCODING_REF: Encoding<'static> = ::objc2::Encoding::Object
The Objective-C type-encoding for a reference of this type. Read more
sourceimpl<T: Message> ToOwned for NSMutableArray<T, Shared>
impl<T: Message> ToOwned for NSMutableArray<T, Shared>
type Owned = Id<NSMutableArray<T, Shared>, Owned>
type Owned = Id<NSMutableArray<T, Shared>, Owned>
The resulting type after obtaining ownership.
sourcefn to_owned(&self) -> Self::Owned
fn to_owned(&self) -> Self::Owned
Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · sourcefn clone_into(&self, target: &mut Self::Owned)
fn clone_into(&self, target: &mut Self::Owned)
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T: Eq, O: Eq + Ownership> Eq for NSMutableArray<T, O>
impl<T, O: Ownership> Message for NSMutableArray<T, O>
Auto Trait Implementations
impl<T, O> !RefUnwindSafe for NSMutableArray<T, O>
impl<T, O> !Send for NSMutableArray<T, O>
impl<T, O> !Sync for NSMutableArray<T, O>
impl<T, O> !Unpin for NSMutableArray<T, O>
impl<T, O> !UnwindSafe for NSMutableArray<T, O>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more