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
20extern_conformance!(
21    unsafe impl NSCoding for MXMetric {}
22);
23
24extern_conformance!(
25    unsafe impl NSObjectProtocol for MXMetric {}
26);
27
28extern_conformance!(
29    unsafe impl NSSecureCoding for MXMetric {}
30);
31
32impl MXMetric {
33    extern_methods!(
34        /// Convenience method to return a JSON representation of this metric.
35        ///
36        /// Returns: An NSData object containing the JSON representation
37        #[unsafe(method(JSONRepresentation))]
38        #[unsafe(method_family = none)]
39        pub unsafe fn JSONRepresentation(&self) -> Retained<NSData>;
40
41        /// Convenience method to return a NSDictionary representation of this metric.
42        ///
43        /// Returns: An NSDictionary object containing the dictionary representation
44        #[deprecated]
45        #[unsafe(method(DictionaryRepresentation))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn DictionaryRepresentation(&self) -> Retained<NSDictionary>;
48
49        /// Convenience method to return a NSDictionary representation of this metric.
50        ///
51        /// Returns: An NSDictionary object containing the dictionary representation
52        #[unsafe(method(dictionaryRepresentation))]
53        #[unsafe(method_family = none)]
54        pub unsafe fn dictionaryRepresentation(&self) -> Retained<NSDictionary>;
55    );
56}
57
58/// Methods declared on superclass `NSObject`.
59impl MXMetric {
60    extern_methods!(
61        #[unsafe(method(init))]
62        #[unsafe(method_family = init)]
63        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
64
65        #[unsafe(method(new))]
66        #[unsafe(method_family = new)]
67        pub unsafe fn new() -> Retained<Self>;
68    );
69}