objc2_metric_kit/generated/
MXMetric.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    /// An abstract class that describes a specific metric vended by MetricKit.
11    ///
12    /// All supported metrics are subclasses of MXMetric.
13    ///
14    /// See also [Apple's documentation](https://developer.apple.com/documentation/metrickit/mxmetric?language=objc)
15    #[unsafe(super(NSObject))]
16    #[derive(Debug, PartialEq, Eq, Hash)]
17    pub struct MXMetric;
18);
19
20unsafe impl NSCoding for MXMetric {}
21
22unsafe impl NSObjectProtocol for MXMetric {}
23
24unsafe impl NSSecureCoding for MXMetric {}
25
26impl MXMetric {
27    extern_methods!(
28        /// Convenience method to return a JSON representation of this metric.
29        ///
30        /// Returns: An NSData object containing the JSON representation
31        #[unsafe(method(JSONRepresentation))]
32        #[unsafe(method_family = none)]
33        pub unsafe fn JSONRepresentation(&self) -> Retained<NSData>;
34
35        /// Convenience method to return a NSDictionary representation of this metric.
36        ///
37        /// Returns: An NSDictionary object containing the dictionary representation
38        #[deprecated]
39        #[unsafe(method(DictionaryRepresentation))]
40        #[unsafe(method_family = none)]
41        pub unsafe fn DictionaryRepresentation(&self) -> Retained<NSDictionary>;
42
43        /// Convenience method to return a NSDictionary representation of this metric.
44        ///
45        /// Returns: An NSDictionary object containing the dictionary representation
46        #[unsafe(method(dictionaryRepresentation))]
47        #[unsafe(method_family = none)]
48        pub unsafe fn dictionaryRepresentation(&self) -> Retained<NSDictionary>;
49    );
50}
51
52/// Methods declared on superclass `NSObject`.
53impl MXMetric {
54    extern_methods!(
55        #[unsafe(method(init))]
56        #[unsafe(method_family = init)]
57        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
58
59        #[unsafe(method(new))]
60        #[unsafe(method_family = new)]
61        pub unsafe fn new() -> Retained<Self>;
62    );
63}