#![allow(dead_code)]
use core::panic::{RefUnwindSafe, UnwindSafe};
use crate::common::*;
#[derive(PartialEq, Eq, Hash, PartialOrd, Ord, Clone, Copy, Debug)]
#[repr(transparent)]
struct UnsafeIgnoreAutoTraits<T: ?Sized>(T);
unsafe impl<T: ?Sized> Send for UnsafeIgnoreAutoTraits<T> {}
unsafe impl<T: ?Sized> Sync for UnsafeIgnoreAutoTraits<T> {}
impl<T: ?Sized> RefUnwindSafe for UnsafeIgnoreAutoTraits<T> {}
impl<T: ?Sized> UnwindSafe for UnsafeIgnoreAutoTraits<T> {}
__inner_extern_class!(
#[derive(PartialEq, Eq, Hash)]
#[cfg(feature = "Foundation_NSArray")]
pub struct NSArray<ObjectType: ?Sized = AnyObject> {
__superclass: UnsafeIgnoreAutoTraits<NSObject>,
__inner: PhantomData<Id<ObjectType>>,
}
#[cfg(feature = "Foundation_NSArray")]
unsafe impl<ObjectType: ?Sized + Message> ClassType for NSArray<ObjectType> {
type Super = NSObject;
type Mutability = ImmutableWithMutableSubclass<NSMutableArray<ObjectType>>;
fn as_super(&self) -> &Self::Super {
&self.__superclass.0
}
fn as_super_mut(&mut self) -> &mut Self::Super {
&mut self.__superclass.0
}
}
);
__inner_extern_class!(
#[derive(PartialEq, Eq, Hash)]
#[cfg(feature = "Foundation_NSArray")]
pub struct NSMutableArray<ObjectType: ?Sized = AnyObject> {
__superclass: NSArray<ObjectType>,
}
#[cfg(feature = "Foundation_NSArray")]
unsafe impl<ObjectType: ?Sized + Message> ClassType for NSMutableArray<ObjectType> {
#[inherits(NSObject)]
type Super = NSArray<ObjectType>;
type Mutability = MutableWithImmutableSuperclass<NSArray<ObjectType>>;
fn as_super(&self) -> &Self::Super {
&self.__superclass
}
fn as_super_mut(&mut self) -> &mut Self::Super {
&mut self.__superclass
}
}
);
__inner_extern_class!(
#[derive(PartialEq, Eq, Hash)]
#[cfg(feature = "Foundation_NSDictionary")]
pub struct NSDictionary<KeyType: ?Sized = AnyObject, ObjectType: ?Sized = AnyObject> {
__superclass: UnsafeIgnoreAutoTraits<NSObject>,
__inner: PhantomData<(Id<KeyType>, Id<ObjectType>)>,
}
#[cfg(feature = "Foundation_NSDictionary")]
unsafe impl<KeyType: ?Sized + Message, ObjectType: ?Sized + Message> ClassType
for NSDictionary<KeyType, ObjectType>
{
type Super = NSObject;
type Mutability = ImmutableWithMutableSubclass<NSMutableDictionary<KeyType, ObjectType>>;
fn as_super(&self) -> &Self::Super {
&self.__superclass.0
}
fn as_super_mut(&mut self) -> &mut Self::Super {
&mut self.__superclass.0
}
}
);
__inner_extern_class!(
#[derive(PartialEq, Eq, Hash)]
#[cfg(feature = "Foundation_NSDictionary")]
pub struct NSMutableDictionary<KeyType: ?Sized = AnyObject, ObjectType: ?Sized = AnyObject> {
__superclass: NSDictionary<KeyType, ObjectType>,
}
#[cfg(feature = "Foundation_NSDictionary")]
unsafe impl<KeyType: ?Sized + Message, ObjectType: ?Sized + Message> ClassType
for NSMutableDictionary<KeyType, ObjectType>
{
#[inherits(NSObject)]
type Super = NSDictionary<KeyType, ObjectType>;
type Mutability = MutableWithImmutableSuperclass<NSDictionary<KeyType, ObjectType>>;
fn as_super(&self) -> &Self::Super {
&self.__superclass
}
fn as_super_mut(&mut self) -> &mut Self::Super {
&mut self.__superclass
}
}
);
__inner_extern_class!(
#[derive(PartialEq, Eq, Hash)]
#[cfg(feature = "Foundation_NSSet")]
pub struct NSSet<ObjectType: ?Sized = AnyObject> {
__superclass: UnsafeIgnoreAutoTraits<NSObject>,
__inner: PhantomData<Id<ObjectType>>,
}
#[cfg(feature = "Foundation_NSSet")]
unsafe impl<ObjectType: ?Sized + Message> ClassType for NSSet<ObjectType> {
type Super = NSObject;
type Mutability = ImmutableWithMutableSubclass<NSMutableSet<ObjectType>>;
fn as_super(&self) -> &Self::Super {
&self.__superclass.0
}
fn as_super_mut(&mut self) -> &mut Self::Super {
&mut self.__superclass.0
}
}
);
__inner_extern_class!(
#[derive(PartialEq, Eq, Hash)]
#[cfg(feature = "Foundation_NSSet")]
pub struct NSMutableSet<ObjectType: ?Sized = AnyObject> {
__superclass: NSSet<ObjectType>,
}
#[cfg(feature = "Foundation_NSSet")]
unsafe impl<ObjectType: ?Sized + Message> ClassType for NSMutableSet<ObjectType> {
#[inherits(NSObject)]
type Super = NSSet<ObjectType>;
type Mutability = MutableWithImmutableSuperclass<NSSet<ObjectType>>;
fn as_super(&self) -> &Self::Super {
&self.__superclass
}
fn as_super_mut(&mut self) -> &mut Self::Super {
&mut self.__superclass
}
}
);
__inner_extern_class!(
#[derive(PartialEq, Eq, Hash)]
#[cfg(feature = "Foundation_NSCountedSet")]
pub struct NSCountedSet<ObjectType: ?Sized = AnyObject> {
__superclass: NSMutableSet<ObjectType>,
}
#[cfg(feature = "Foundation_NSCountedSet")]
unsafe impl<ObjectType: ?Sized + Message> ClassType for NSCountedSet<ObjectType> {
#[inherits(NSSet<ObjectType>, NSObject)]
type Super = NSMutableSet<ObjectType>;
type Mutability = Mutable;
fn as_super(&self) -> &Self::Super {
&self.__superclass
}
fn as_super_mut(&mut self) -> &mut Self::Super {
&mut self.__superclass
}
}
);
__inner_extern_class!(
#[derive(PartialEq, Eq, Hash)]
#[cfg(feature = "Foundation_NSOrderedSet")]
pub struct NSOrderedSet<ObjectType: ?Sized = AnyObject> {
__superclass: UnsafeIgnoreAutoTraits<NSObject>,
__inner: PhantomData<Id<ObjectType>>,
}
#[cfg(feature = "Foundation_NSOrderedSet")]
unsafe impl<ObjectType: ?Sized + Message> ClassType for NSOrderedSet<ObjectType> {
type Super = NSObject;
type Mutability = ImmutableWithMutableSubclass<NSMutableOrderedSet<ObjectType>>;
fn as_super(&self) -> &Self::Super {
&self.__superclass.0
}
fn as_super_mut(&mut self) -> &mut Self::Super {
&mut self.__superclass.0
}
}
);
__inner_extern_class!(
#[derive(PartialEq, Eq, Hash)]
#[cfg(feature = "Foundation_NSOrderedSet")]
pub struct NSMutableOrderedSet<ObjectType: ?Sized = AnyObject> {
__superclass: NSOrderedSet<ObjectType>,
}
#[cfg(feature = "Foundation_NSOrderedSet")]
unsafe impl<ObjectType: ?Sized + Message> ClassType for NSMutableOrderedSet<ObjectType> {
#[inherits(NSObject)]
type Super = NSOrderedSet<ObjectType>;
type Mutability = MutableWithImmutableSuperclass<NSOrderedSet<ObjectType>>;
fn as_super(&self) -> &Self::Super {
&self.__superclass
}
fn as_super_mut(&mut self) -> &mut Self::Super {
&mut self.__superclass
}
}
);
__inner_extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "Foundation_NSEnumerator")]
pub struct NSEnumerator<ObjectType: ?Sized = AnyObject> {
__superclass: UnsafeIgnoreAutoTraits<NSObject>,
__inner: PhantomData<Id<ObjectType>>,
}
#[cfg(feature = "Foundation_NSEnumerator")]
unsafe impl<ObjectType: ?Sized + Message> ClassType for NSEnumerator<ObjectType> {
type Super = NSObject;
type Mutability = Mutable;
fn as_super(&self) -> &Self::Super {
&self.__superclass.0
}
fn as_super_mut(&mut self) -> &mut Self::Super {
&mut self.__superclass.0
}
}
);