objc2_metric_kit/generated/
MXDiskSpaceUsageMetric.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 MXMetric subclass that encapsulates app disk space usage Metrics.
11    ///
12    /// Disk space is a shared resource on-device, and overusage of available disk space can negatively impact the customer experience.
13    ///
14    /// This Metric subclass contains properties that describe disk space usage in various locations in the apps container. Some properties also describe the number of files in common locations, and the types of files.
15    ///
16    /// The data contained in this Metric is computed as a daily snapshot, and should be used as a guide to optimize app disk space usage.
17    ///
18    /// See also [Apple's documentation](https://developer.apple.com/documentation/metrickit/mxdiskspaceusagemetric?language=objc)
19    #[unsafe(super(MXMetric, NSObject))]
20    #[derive(Debug, PartialEq, Eq, Hash)]
21    #[cfg(feature = "MXMetric")]
22    pub struct MXDiskSpaceUsageMetric;
23);
24
25#[cfg(feature = "MXMetric")]
26extern_conformance!(
27    unsafe impl NSCoding for MXDiskSpaceUsageMetric {}
28);
29
30#[cfg(feature = "MXMetric")]
31extern_conformance!(
32    unsafe impl NSObjectProtocol for MXDiskSpaceUsageMetric {}
33);
34
35#[cfg(feature = "MXMetric")]
36extern_conformance!(
37    unsafe impl NSSecureCoding for MXDiskSpaceUsageMetric {}
38);
39
40#[cfg(feature = "MXMetric")]
41impl MXDiskSpaceUsageMetric {
42    extern_methods!(
43        /// Total fixed size used by the app.
44        ///
45        /// Dimensioned as NSUnitInformationStorage, base unit is bytes.
46        #[unsafe(method(totalBinaryFileSize))]
47        #[unsafe(method_family = none)]
48        pub unsafe fn totalBinaryFileSize(
49            &self,
50        ) -> Retained<NSMeasurement<NSUnitInformationStorage>>;
51
52        /// Total count of fixed files owned by the app.
53        #[unsafe(method(totalBinaryFileCount))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn totalBinaryFileCount(&self) -> NSInteger;
56
57        /// Total data file size used by the app.
58        ///
59        /// Dimensioned as NSUnitInformationStorage, base unit is bytes.
60        #[unsafe(method(totalDataFileSize))]
61        #[unsafe(method_family = none)]
62        pub unsafe fn totalDataFileSize(&self)
63            -> Retained<NSMeasurement<NSUnitInformationStorage>>;
64
65        /// Total count of data files owned by the app.
66        #[unsafe(method(totalDataFileCount))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn totalDataFileCount(&self) -> NSInteger;
69
70        /// Total file size contained within the apps cache folder.
71        ///
72        /// Dimensioned as NSUnitInformationStorage, base unit is bytes.
73        #[unsafe(method(totalCacheFolderSize))]
74        #[unsafe(method_family = none)]
75        pub unsafe fn totalCacheFolderSize(
76            &self,
77        ) -> Retained<NSMeasurement<NSUnitInformationStorage>>;
78
79        /// Total clone size used by the app.
80        ///
81        /// Dimensioned as NSUnitInformationStorage, base unit is bytes.
82        #[unsafe(method(totalCloneSize))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn totalCloneSize(&self) -> Retained<NSMeasurement<NSUnitInformationStorage>>;
85
86        /// Total disk space used by the app.
87        ///
88        /// Dimensioned as NSUnitInformationStorage, base unit is bytes.
89        #[unsafe(method(totalDiskSpaceUsedSize))]
90        #[unsafe(method_family = none)]
91        pub unsafe fn totalDiskSpaceUsedSize(
92            &self,
93        ) -> Retained<NSMeasurement<NSUnitInformationStorage>>;
94
95        /// Total disk space capacity of the device
96        ///
97        /// Dimensioned as NSUnitInformationStorage, base unit is bytes.
98        #[unsafe(method(totalDiskSpaceCapacity))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn totalDiskSpaceCapacity(
101            &self,
102        ) -> Retained<NSMeasurement<NSUnitInformationStorage>>;
103    );
104}
105
106/// Methods declared on superclass `NSObject`.
107#[cfg(feature = "MXMetric")]
108impl MXDiskSpaceUsageMetric {
109    extern_methods!(
110        #[unsafe(method(init))]
111        #[unsafe(method_family = init)]
112        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
113
114        #[unsafe(method(new))]
115        #[unsafe(method_family = new)]
116        pub unsafe fn new() -> Retained<Self>;
117    );
118}