I'm working on implementing common traits for public facing types
Unfortunately this doesn't seem trivial, since some types are declared using the declare_TCFType macro, so deriving them is not possible. I tried implementing them by hand, but this doesn't seem to have an effect.
Implementation of traits for `SecIdentity`
```rs
declare_TCFType! {
/// A type representing an identity.
///
/// Identities are a certificate paired with the corresponding private key.
SecIdentity, SecIdentityRef
}
impl_TCFType!(SecIdentity, SecIdentityRef, SecIdentityGetTypeID);
impl Copy for SecIdentity {}
impl Clone for SecIdentity {}
impl Eq for SecIdentity {}
impl PartialEq for SecIdentity {}
impl Ord for SecIdentity {}
impl PartialOrd for SecIdentity {}
impl Hash for SecIdentity {}
impl Debug for SecIdentity {}
impl Default for SecIdentity {}
```
Error describing that `SecIdentity` doesn't implement `Copy`
```
error[E0204]: the trait `Copy` may not be implemented for this type
--> src/imp/security_framework.rs:78:10
|
78 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Default)]
| ^^^^
79 | pub struct Identity {
80 | identity: SecIdentity,
| --------------------- this field does not implement `Copy`
81 | chain: Vec,
| -------------------------- this field does not implement `Copy`
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
```
I must say that I'm not familiar with this macro, so it could just be that I'm missing something. Do you know a way around this issue?
I'm working on implementing common traits for public facing types
Unfortunately this doesn't seem trivial, since some types are declared using the
declare_TCFType
macro, so deriving them is not possible. I tried implementing them by hand, but this doesn't seem to have an effect.Implementation of traits for `SecIdentity`
```rs declare_TCFType! { /// A type representing an identity. /// /// Identities are a certificate paired with the corresponding private key. SecIdentity, SecIdentityRef } impl_TCFType!(SecIdentity, SecIdentityRef, SecIdentityGetTypeID); impl Copy for SecIdentity {} impl Clone for SecIdentity {} impl Eq for SecIdentity {} impl PartialEq for SecIdentity {} impl Ord for SecIdentity {} impl PartialOrd for SecIdentity {} impl Hash for SecIdentity {} impl Debug for SecIdentity {} impl Default for SecIdentity {} ```Error describing that `SecIdentity` doesn't implement `Copy`
``` error[E0204]: the trait `Copy` may not be implemented for this type --> src/imp/security_framework.rs:78:10 | 78 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Default)] | ^^^^ 79 | pub struct Identity { 80 | identity: SecIdentity, | --------------------- this field does not implement `Copy` 81 | chain: VecI must say that I'm not familiar with this macro, so it could just be that I'm missing something. Do you know a way around this issue?
Thanks for feedback of any kind!
Related: #146