objc2_metric_kit/generated/
MXHistogram.rs1use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10 #[unsafe(super(NSObject))]
18 #[derive(Debug, PartialEq, Eq, Hash)]
19 pub struct MXHistogramBucket<UnitType: ?Sized = AnyObject>;
20);
21
22impl<UnitType: ?Sized + Message + AsRef<NSUnit>> MXHistogramBucket<UnitType> {
23 #[inline]
29 pub unsafe fn cast_unchecked<NewUnitType: ?Sized + Message + AsRef<NSUnit>>(
30 &self,
31 ) -> &MXHistogramBucket<NewUnitType> {
32 unsafe { &*((self as *const Self).cast()) }
33 }
34}
35
36extern_conformance!(
37 unsafe impl<UnitType: ?Sized + NSCoding + AsRef<NSUnit>> NSCoding for MXHistogramBucket<UnitType> {}
38);
39
40extern_conformance!(
41 unsafe impl<UnitType: ?Sized + AsRef<NSUnit>> NSObjectProtocol for MXHistogramBucket<UnitType> {}
42);
43
44extern_conformance!(
45 unsafe impl<UnitType: ?Sized + NSSecureCoding + AsRef<NSUnit>> NSSecureCoding
46 for MXHistogramBucket<UnitType>
47 {
48 }
49);
50
51impl<UnitType: Message + AsRef<NSUnit>> MXHistogramBucket<UnitType> {
52 extern_methods!(
53 #[unsafe(method(bucketStart))]
55 #[unsafe(method_family = none)]
56 pub unsafe fn bucketStart(&self) -> Retained<NSMeasurement<UnitType>>;
57
58 #[unsafe(method(bucketEnd))]
60 #[unsafe(method_family = none)]
61 pub unsafe fn bucketEnd(&self) -> Retained<NSMeasurement<UnitType>>;
62
63 #[unsafe(method(bucketCount))]
65 #[unsafe(method_family = none)]
66 pub unsafe fn bucketCount(&self) -> NSUInteger;
67 );
68}
69
70impl<UnitType: Message + AsRef<NSUnit>> MXHistogramBucket<UnitType> {
72 extern_methods!(
73 #[unsafe(method(init))]
74 #[unsafe(method_family = init)]
75 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
76
77 #[unsafe(method(new))]
78 #[unsafe(method_family = new)]
79 pub unsafe fn new() -> Retained<Self>;
80 );
81}
82
83extern_class!(
84 #[unsafe(super(NSObject))]
88 #[derive(Debug, PartialEq, Eq, Hash)]
89 pub struct MXHistogram<UnitType: ?Sized = AnyObject>;
90);
91
92impl<UnitType: ?Sized + Message + AsRef<NSUnit>> MXHistogram<UnitType> {
93 #[inline]
99 pub unsafe fn cast_unchecked<NewUnitType: ?Sized + Message + AsRef<NSUnit>>(
100 &self,
101 ) -> &MXHistogram<NewUnitType> {
102 unsafe { &*((self as *const Self).cast()) }
103 }
104}
105
106extern_conformance!(
107 unsafe impl<UnitType: ?Sized + NSCoding + AsRef<NSUnit>> NSCoding for MXHistogram<UnitType> {}
108);
109
110extern_conformance!(
111 unsafe impl<UnitType: ?Sized + AsRef<NSUnit>> NSObjectProtocol for MXHistogram<UnitType> {}
112);
113
114extern_conformance!(
115 unsafe impl<UnitType: ?Sized + NSSecureCoding + AsRef<NSUnit>> NSSecureCoding
116 for MXHistogram<UnitType>
117 {
118 }
119);
120
121impl<UnitType: Message + AsRef<NSUnit>> MXHistogram<UnitType> {
122 extern_methods!(
123 #[unsafe(method(totalBucketCount))]
127 #[unsafe(method_family = none)]
128 pub unsafe fn totalBucketCount(&self) -> NSUInteger;
129
130 #[unsafe(method(bucketEnumerator))]
136 #[unsafe(method_family = none)]
137 pub unsafe fn bucketEnumerator(
138 &self,
139 ) -> Retained<NSEnumerator<MXHistogramBucket<UnitType>>>;
140 );
141}
142
143impl<UnitType: Message + AsRef<NSUnit>> MXHistogram<UnitType> {
145 extern_methods!(
146 #[unsafe(method(init))]
147 #[unsafe(method_family = init)]
148 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
149
150 #[unsafe(method(new))]
151 #[unsafe(method_family = new)]
152 pub unsafe fn new() -> Retained<Self>;
153 );
154}