objc2_metric_kit/generated/
MXHistogram.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10    /// A class that represents a bucket within an MXHistogram
11    ///
12    /// Histogram buckets are sorted in ascending order.
13    ///
14    /// Histogram bucket start and end values are exclusive.
15    ///
16    /// See also [Apple's documentation](https://developer.apple.com/documentation/metrickit/mxhistogrambucket?language=objc)
17    #[unsafe(super(NSObject))]
18    #[derive(Debug, PartialEq, Eq, Hash)]
19    pub struct MXHistogramBucket<UnitType: ?Sized = AnyObject>;
20);
21
22extern_conformance!(
23    unsafe impl<UnitType: ?Sized + NSCoding> NSCoding for MXHistogramBucket<UnitType> {}
24);
25
26extern_conformance!(
27    unsafe impl<UnitType: ?Sized> NSObjectProtocol for MXHistogramBucket<UnitType> {}
28);
29
30extern_conformance!(
31    unsafe impl<UnitType: ?Sized + NSSecureCoding> NSSecureCoding for MXHistogramBucket<UnitType> {}
32);
33
34impl<UnitType: Message> MXHistogramBucket<UnitType> {
35    extern_methods!(
36        /// An NSMeasurement representing the start of a histogram bucket.
37        #[unsafe(method(bucketStart))]
38        #[unsafe(method_family = none)]
39        pub unsafe fn bucketStart(&self) -> Retained<NSMeasurement<UnitType>>;
40
41        /// An NSMeasurement representing the end of a histogram bucket.
42        #[unsafe(method(bucketEnd))]
43        #[unsafe(method_family = none)]
44        pub unsafe fn bucketEnd(&self) -> Retained<NSMeasurement<UnitType>>;
45
46        /// An NSUInteger representing the number of samples in this histogram bucket.
47        #[unsafe(method(bucketCount))]
48        #[unsafe(method_family = none)]
49        pub unsafe fn bucketCount(&self) -> NSUInteger;
50    );
51}
52
53/// Methods declared on superclass `NSObject`.
54impl<UnitType: Message> MXHistogramBucket<UnitType> {
55    extern_methods!(
56        #[unsafe(method(init))]
57        #[unsafe(method_family = init)]
58        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
59
60        #[unsafe(method(new))]
61        #[unsafe(method_family = new)]
62        pub unsafe fn new() -> Retained<Self>;
63    );
64}
65
66extern_class!(
67    /// A class representing bucketized histogram data.
68    ///
69    /// See also [Apple's documentation](https://developer.apple.com/documentation/metrickit/mxhistogram?language=objc)
70    #[unsafe(super(NSObject))]
71    #[derive(Debug, PartialEq, Eq, Hash)]
72    pub struct MXHistogram<UnitType: ?Sized = AnyObject>;
73);
74
75extern_conformance!(
76    unsafe impl<UnitType: ?Sized + NSCoding> NSCoding for MXHistogram<UnitType> {}
77);
78
79extern_conformance!(
80    unsafe impl<UnitType: ?Sized> NSObjectProtocol for MXHistogram<UnitType> {}
81);
82
83extern_conformance!(
84    unsafe impl<UnitType: ?Sized + NSSecureCoding> NSSecureCoding for MXHistogram<UnitType> {}
85);
86
87impl<UnitType: Message> MXHistogram<UnitType> {
88    extern_methods!(
89        /// The number of buckets contained within this histogram.
90        ///
91        /// This value can never be negative.
92        #[unsafe(method(totalBucketCount))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn totalBucketCount(&self) -> NSUInteger;
95
96        /// An NSEnumerator that can be used to enumerate the buckets of this histogram.
97        #[unsafe(method(bucketEnumerator))]
98        #[unsafe(method_family = none)]
99        pub unsafe fn bucketEnumerator(
100            &self,
101        ) -> Retained<NSEnumerator<MXHistogramBucket<UnitType>>>;
102    );
103}
104
105/// Methods declared on superclass `NSObject`.
106impl<UnitType: Message> MXHistogram<UnitType> {
107    extern_methods!(
108        #[unsafe(method(init))]
109        #[unsafe(method_family = init)]
110        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
111
112        #[unsafe(method(new))]
113        #[unsafe(method_family = new)]
114        pub unsafe fn new() -> Retained<Self>;
115    );
116}