ptr_meta/
impls.rs

1use core::{any::Any, error::Error};
2
3use crate::{DynMetadata, Pointee};
4
5// SAFETY: The metadata type of `dyn Any` is `DynMetadata<dyn Any>`.
6unsafe impl Pointee for dyn Any {
7    type Metadata = DynMetadata<dyn Any>;
8}
9
10// SAFETY: The metadata type of `dyn Any + Send` is
11// `DynMetadata<dyn Any + Send>`.
12unsafe impl Pointee for dyn Any + Send {
13    type Metadata = DynMetadata<dyn Any + Send>;
14}
15
16// SAFETY: The metadata type of `dyn Any + Sync` is
17// `DynMetadata<dyn Any + Sync>`.
18unsafe impl Pointee for dyn Any + Sync {
19    type Metadata = DynMetadata<dyn Any + Sync>;
20}
21
22// SAFETY: The metadata type of `dyn Any + Send + Sync` is
23// `DynMetadata<dyn Any + Send + Sync>`.
24unsafe impl Pointee for dyn Any + Send + Sync {
25    type Metadata = DynMetadata<dyn Any + Send + Sync>;
26}
27
28// SAFETY: The metadata type of `dyn Error` is `DynMetadata<dyn Error>`.
29unsafe impl Pointee for dyn Error {
30    type Metadata = DynMetadata<dyn Error>;
31}
32
33// SAFETY: The metadata type of `dyn Error + Send` is
34// `DynMetadata<dyn Error + Send>`.
35unsafe impl Pointee for dyn Error + Send {
36    type Metadata = DynMetadata<dyn Error + Send>;
37}
38
39// SAFETY: The metadata type of `dyn Error + Sync` is
40// `DynMetadata<dyn Error + Sync>`.
41unsafe impl Pointee for dyn Error + Sync {
42    type Metadata = DynMetadata<dyn Error + Sync>;
43}
44
45// SAFETY: The metadata type of `dyn Error + Send + Sync` is
46// `DynMetadata<dyn Error + Send + Sync>`.
47unsafe impl Pointee for dyn Error + Send + Sync {
48    type Metadata = DynMetadata<dyn Error + Send + Sync>;
49}