1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#![allow(unused_imports)]
use alloc::borrow::ToOwned;

use objc2::mutability::IsIdCloneable;
use objc2::rc::Retained;
use objc2::Message;

use crate::Foundation::{self, NSCopying, NSMutableCopying};

#[cfg(feature = "NSArray")]
impl<T: Message + IsIdCloneable> ToOwned for Foundation::NSArray<T> {
    type Owned = Retained<Self>;
    fn to_owned(&self) -> Self::Owned {
        self.copy()
    }
}

#[cfg(feature = "NSArray")]
impl<T: Message + IsIdCloneable> ToOwned for Foundation::NSMutableArray<T> {
    type Owned = Retained<Self>;
    fn to_owned(&self) -> Self::Owned {
        self.mutableCopy()
    }
}

#[cfg(feature = "NSData")]
impl ToOwned for Foundation::NSData {
    type Owned = Retained<Self>;
    fn to_owned(&self) -> Self::Owned {
        self.copy()
    }
}

#[cfg(feature = "NSData")]
impl ToOwned for Foundation::NSMutableData {
    type Owned = Retained<Self>;
    fn to_owned(&self) -> Self::Owned {
        self.mutableCopy()
    }
}

#[cfg(feature = "NSException")]
impl ToOwned for Foundation::NSException {
    type Owned = Retained<Self>;
    fn to_owned(&self) -> Self::Owned {
        self.copy()
    }
}

#[cfg(feature = "NSSet")]
impl<T: Message + IsIdCloneable> ToOwned for Foundation::NSSet<T> {
    type Owned = Retained<Self>;
    fn to_owned(&self) -> Self::Owned {
        self.copy()
    }
}

#[cfg(feature = "NSSet")]
impl<T: Message + IsIdCloneable> ToOwned for Foundation::NSMutableSet<T> {
    type Owned = Retained<Self>;
    fn to_owned(&self) -> Self::Owned {
        self.mutableCopy()
    }
}

#[cfg(feature = "NSString")]
impl ToOwned for Foundation::NSString {
    type Owned = Retained<Self>;
    fn to_owned(&self) -> Self::Owned {
        self.copy()
    }
}

#[cfg(feature = "NSString")]
impl ToOwned for Foundation::NSMutableString {
    type Owned = Retained<Self>;
    fn to_owned(&self) -> Self::Owned {
        self.mutableCopy()
    }
}

#[cfg(feature = "NSAttributedString")]
impl ToOwned for Foundation::NSAttributedString {
    type Owned = Retained<Self>;
    fn to_owned(&self) -> Self::Owned {
        self.copy()
    }
}

#[cfg(feature = "NSAttributedString")]
impl ToOwned for Foundation::NSMutableAttributedString {
    type Owned = Retained<Self>;
    fn to_owned(&self) -> Self::Owned {
        self.mutableCopy()
    }
}

#[cfg(feature = "NSUUID")]
impl ToOwned for Foundation::NSUUID {
    type Owned = Retained<Self>;
    fn to_owned(&self) -> Self::Owned {
        self.copy()
    }
}

#[cfg(feature = "NSValue")]
impl ToOwned for Foundation::NSValue {
    type Owned = Retained<Self>;
    fn to_owned(&self) -> Self::Owned {
        self.copy()
    }
}

#[cfg(feature = "NSValue")]
impl ToOwned for Foundation::NSNumber {
    type Owned = Retained<Self>;
    fn to_owned(&self) -> Self::Owned {
        self.copy()
    }
}