//! This file has been automatically generated by `objc2`'s `header-translator`. //! DO NOT EDIT use core::ffi::*; use core::ptr::NonNull; use objc2::__framework_prelude::*; use crate::*; extern_class!( /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsmeasurement?language=objc) #[unsafe(super(NSObject))] #[derive(Debug, PartialEq, Eq, Hash)] #[cfg(feature = "NSUnit")] pub struct NSMeasurement; ); #[cfg(feature = "NSUnit")] impl> NSMeasurement { /// Unchecked conversion of the generic parameter. /// /// # Safety /// /// The generic must be valid to reinterpret as the given type. #[inline] pub unsafe fn cast_unchecked>( &self, ) -> &NSMeasurement { unsafe { &*((self as *const Self).cast()) } } } #[cfg(all(feature = "NSObject", feature = "NSUnit"))] extern_conformance!( unsafe impl> NSCoding for NSMeasurement {} ); #[cfg(all(feature = "NSObject", feature = "NSUnit"))] extern_conformance!( unsafe impl> NSCopying for NSMeasurement {} ); #[cfg(all(feature = "NSObject", feature = "NSUnit"))] unsafe impl> CopyingHelper for NSMeasurement { type Result = Self; } #[cfg(feature = "NSUnit")] extern_conformance!( unsafe impl> NSObjectProtocol for NSMeasurement {} ); #[cfg(all(feature = "NSObject", feature = "NSUnit"))] extern_conformance!( unsafe impl> NSSecureCoding for NSMeasurement { } ); #[cfg(feature = "NSUnit")] impl> NSMeasurement { extern_methods!( #[unsafe(method(unit))] #[unsafe(method_family = none)] pub fn unit(&self) -> Retained; #[unsafe(method(doubleValue))] #[unsafe(method_family = none)] pub fn doubleValue(&self) -> c_double; #[unsafe(method(init))] #[unsafe(method_family = init)] pub unsafe fn init(this: Allocated) -> Retained; #[unsafe(method(initWithDoubleValue:unit:))] #[unsafe(method_family = init)] pub fn initWithDoubleValue_unit( this: Allocated, double_value: c_double, unit: &UnitType, ) -> Retained; #[unsafe(method(canBeConvertedToUnit:))] #[unsafe(method_family = none)] pub fn canBeConvertedToUnit(&self, unit: &NSUnit) -> bool; #[unsafe(method(measurementByConvertingToUnit:))] #[unsafe(method_family = none)] pub fn measurementByConvertingToUnit(&self, unit: &NSUnit) -> Retained; #[unsafe(method(measurementByAddingMeasurement:))] #[unsafe(method_family = none)] pub fn measurementByAddingMeasurement( &self, measurement: &NSMeasurement, ) -> Retained>; #[unsafe(method(measurementBySubtractingMeasurement:))] #[unsafe(method_family = none)] pub fn measurementBySubtractingMeasurement( &self, measurement: &NSMeasurement, ) -> Retained>; ); } /// Methods declared on superclass `NSObject`. #[cfg(feature = "NSUnit")] impl> NSMeasurement { extern_methods!( #[unsafe(method(new))] #[unsafe(method_family = new)] pub unsafe fn new() -> Retained; ); }