icrate/generated/Foundation/
NSEnumerator.rs1use crate::common::*;
4use crate::Foundation::*;
5
6extern_protocol!(
7 pub unsafe trait NSFastEnumeration {
8 #[method(countByEnumeratingWithState:objects:count:)]
9 unsafe fn countByEnumeratingWithState_objects_count(
10 &self,
11 state: NonNull<NSFastEnumerationState>,
12 buffer: NonNull<*mut AnyObject>,
13 len: NSUInteger,
14 ) -> NSUInteger;
15 }
16
17 unsafe impl ProtocolType for dyn NSFastEnumeration {}
18);
19
20#[cfg(feature = "Foundation_NSEnumerator")]
21unsafe impl<ObjectType: ?Sized> NSFastEnumeration for NSEnumerator<ObjectType> {}
22
23#[cfg(feature = "Foundation_NSEnumerator")]
24unsafe impl<ObjectType: ?Sized> NSObjectProtocol for NSEnumerator<ObjectType> {}
25
26extern_methods!(
27 #[cfg(feature = "Foundation_NSEnumerator")]
28 unsafe impl<ObjectType: Message> NSEnumerator<ObjectType> {
29 #[method_id(@__retain_semantics Other nextObject)]
30 pub fn nextObject(&mut self) -> Option<Id<ObjectType>>;
31 }
32);
33
34extern_methods!(
35 #[cfg(feature = "Foundation_NSEnumerator")]
37 unsafe impl<ObjectType: Message> NSEnumerator<ObjectType> {
38 #[method_id(@__retain_semantics Init init)]
39 pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
40
41 #[method_id(@__retain_semantics New new)]
42 pub unsafe fn new() -> Id<Self>;
43 }
44);
45
46extern_methods!(
47 #[cfg(feature = "Foundation_NSEnumerator")]
49 unsafe impl<ObjectType: Message> NSEnumerator<ObjectType> {
50 #[cfg(feature = "Foundation_NSArray")]
51 #[method_id(@__retain_semantics Other allObjects)]
52 pub fn allObjects(&self) -> Id<NSArray<ObjectType>>;
53 }
54);