Struct objc2_foundation::NSUnit
source · #[repr(C)]pub struct NSUnit { /* private fields */ }
Available on crate feature
NSUnit
only.Implementations§
source§impl NSUnit
impl NSUnit
pub unsafe fn symbol(&self) -> Retained<NSString>
Available on crate feature
NSString
only.pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>
pub unsafe fn new() -> Retained<Self>
pub unsafe fn initWithSymbol( this: Allocated<Self>, symbol: &NSString ) -> Retained<Self>
Available on crate feature
NSString
only.Methods from Deref<Target = NSObject>§
sourcepub fn doesNotRecognizeSelector(&self, sel: Sel) -> !
pub fn doesNotRecognizeSelector(&self, sel: Sel) -> !
Handle messages the object doesn’t recognize.
See Apple’s documentation for details.
Methods from Deref<Target = AnyObject>§
sourcepub fn class(&self) -> &'static AnyClass
pub fn class(&self) -> &'static AnyClass
Dynamically find the class of this object.
§Example
Check that an instance of NSObject
has the precise class NSObject
.
use objc2::ClassType;
use objc2::runtime::NSObject;
let obj = NSObject::new();
assert_eq!(obj.class(), NSObject::class());
sourcepub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
👎Deprecated: this is difficult to use correctly, use Ivar::load
instead.
pub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
Ivar::load
instead.Use Ivar::load
instead.
§Safety
The object must have an instance variable with the given name, and it
must be of type T
.
See Ivar::load_ptr
for details surrounding this.
sourcepub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
👎Deprecated: this is difficult to use correctly, use Ivar::load_mut
instead.
pub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
Ivar::load_mut
instead.Use Ivar::load_mut
instead.
§Safety
The object must have an instance variable with the given name, and it
must be of type T
.
See Ivar::load_ptr
for details surrounding this.
Trait Implementations§
source§impl AsMut<NSUnit> for NSDimension
impl AsMut<NSUnit> for NSDimension
source§impl AsMut<NSUnit> for NSUnitAcceleration
impl AsMut<NSUnit> for NSUnitAcceleration
source§impl AsMut<NSUnit> for NSUnitAngle
impl AsMut<NSUnit> for NSUnitAngle
source§impl AsMut<NSUnit> for NSUnitArea
impl AsMut<NSUnit> for NSUnitArea
source§impl AsMut<NSUnit> for NSUnitConcentrationMass
impl AsMut<NSUnit> for NSUnitConcentrationMass
source§impl AsMut<NSUnit> for NSUnitDispersion
impl AsMut<NSUnit> for NSUnitDispersion
source§impl AsMut<NSUnit> for NSUnitDuration
impl AsMut<NSUnit> for NSUnitDuration
source§impl AsMut<NSUnit> for NSUnitElectricCharge
impl AsMut<NSUnit> for NSUnitElectricCharge
source§impl AsMut<NSUnit> for NSUnitElectricCurrent
impl AsMut<NSUnit> for NSUnitElectricCurrent
source§impl AsMut<NSUnit> for NSUnitElectricResistance
impl AsMut<NSUnit> for NSUnitElectricResistance
source§impl AsMut<NSUnit> for NSUnitEnergy
impl AsMut<NSUnit> for NSUnitEnergy
source§impl AsMut<NSUnit> for NSUnitFrequency
impl AsMut<NSUnit> for NSUnitFrequency
source§impl AsMut<NSUnit> for NSUnitFuelEfficiency
impl AsMut<NSUnit> for NSUnitFuelEfficiency
source§impl AsMut<NSUnit> for NSUnitIlluminance
impl AsMut<NSUnit> for NSUnitIlluminance
source§impl AsMut<NSUnit> for NSUnitInformationStorage
impl AsMut<NSUnit> for NSUnitInformationStorage
source§impl AsMut<NSUnit> for NSUnitLength
impl AsMut<NSUnit> for NSUnitLength
source§impl AsMut<NSUnit> for NSUnitMass
impl AsMut<NSUnit> for NSUnitMass
source§impl AsMut<NSUnit> for NSUnitPower
impl AsMut<NSUnit> for NSUnitPower
source§impl AsMut<NSUnit> for NSUnitPressure
impl AsMut<NSUnit> for NSUnitPressure
source§impl AsMut<NSUnit> for NSUnitSpeed
impl AsMut<NSUnit> for NSUnitSpeed
source§impl AsMut<NSUnit> for NSUnitTemperature
impl AsMut<NSUnit> for NSUnitTemperature
source§impl AsMut<NSUnit> for NSUnitVolume
impl AsMut<NSUnit> for NSUnitVolume
source§impl AsRef<NSUnit> for NSDimension
impl AsRef<NSUnit> for NSDimension
source§impl AsRef<NSUnit> for NSUnitAcceleration
impl AsRef<NSUnit> for NSUnitAcceleration
source§impl AsRef<NSUnit> for NSUnitAngle
impl AsRef<NSUnit> for NSUnitAngle
source§impl AsRef<NSUnit> for NSUnitArea
impl AsRef<NSUnit> for NSUnitArea
source§impl AsRef<NSUnit> for NSUnitConcentrationMass
impl AsRef<NSUnit> for NSUnitConcentrationMass
source§impl AsRef<NSUnit> for NSUnitDispersion
impl AsRef<NSUnit> for NSUnitDispersion
source§impl AsRef<NSUnit> for NSUnitDuration
impl AsRef<NSUnit> for NSUnitDuration
source§impl AsRef<NSUnit> for NSUnitElectricCharge
impl AsRef<NSUnit> for NSUnitElectricCharge
source§impl AsRef<NSUnit> for NSUnitElectricCurrent
impl AsRef<NSUnit> for NSUnitElectricCurrent
source§impl AsRef<NSUnit> for NSUnitElectricResistance
impl AsRef<NSUnit> for NSUnitElectricResistance
source§impl AsRef<NSUnit> for NSUnitEnergy
impl AsRef<NSUnit> for NSUnitEnergy
source§impl AsRef<NSUnit> for NSUnitFrequency
impl AsRef<NSUnit> for NSUnitFrequency
source§impl AsRef<NSUnit> for NSUnitFuelEfficiency
impl AsRef<NSUnit> for NSUnitFuelEfficiency
source§impl AsRef<NSUnit> for NSUnitIlluminance
impl AsRef<NSUnit> for NSUnitIlluminance
source§impl AsRef<NSUnit> for NSUnitInformationStorage
impl AsRef<NSUnit> for NSUnitInformationStorage
source§impl AsRef<NSUnit> for NSUnitLength
impl AsRef<NSUnit> for NSUnitLength
source§impl AsRef<NSUnit> for NSUnitMass
impl AsRef<NSUnit> for NSUnitMass
source§impl AsRef<NSUnit> for NSUnitPower
impl AsRef<NSUnit> for NSUnitPower
source§impl AsRef<NSUnit> for NSUnitPressure
impl AsRef<NSUnit> for NSUnitPressure
source§impl AsRef<NSUnit> for NSUnitSpeed
impl AsRef<NSUnit> for NSUnitSpeed
source§impl AsRef<NSUnit> for NSUnitTemperature
impl AsRef<NSUnit> for NSUnitTemperature
source§impl AsRef<NSUnit> for NSUnitVolume
impl AsRef<NSUnit> for NSUnitVolume
source§impl Borrow<NSUnit> for NSDimension
impl Borrow<NSUnit> for NSDimension
source§impl Borrow<NSUnit> for NSUnitAcceleration
impl Borrow<NSUnit> for NSUnitAcceleration
source§impl Borrow<NSUnit> for NSUnitAngle
impl Borrow<NSUnit> for NSUnitAngle
source§impl Borrow<NSUnit> for NSUnitArea
impl Borrow<NSUnit> for NSUnitArea
source§impl Borrow<NSUnit> for NSUnitConcentrationMass
impl Borrow<NSUnit> for NSUnitConcentrationMass
source§impl Borrow<NSUnit> for NSUnitDispersion
impl Borrow<NSUnit> for NSUnitDispersion
source§impl Borrow<NSUnit> for NSUnitDuration
impl Borrow<NSUnit> for NSUnitDuration
source§impl Borrow<NSUnit> for NSUnitElectricCharge
impl Borrow<NSUnit> for NSUnitElectricCharge
source§impl Borrow<NSUnit> for NSUnitElectricCurrent
impl Borrow<NSUnit> for NSUnitElectricCurrent
source§impl Borrow<NSUnit> for NSUnitElectricResistance
impl Borrow<NSUnit> for NSUnitElectricResistance
source§impl Borrow<NSUnit> for NSUnitEnergy
impl Borrow<NSUnit> for NSUnitEnergy
source§impl Borrow<NSUnit> for NSUnitFrequency
impl Borrow<NSUnit> for NSUnitFrequency
source§impl Borrow<NSUnit> for NSUnitFuelEfficiency
impl Borrow<NSUnit> for NSUnitFuelEfficiency
source§impl Borrow<NSUnit> for NSUnitIlluminance
impl Borrow<NSUnit> for NSUnitIlluminance
source§impl Borrow<NSUnit> for NSUnitInformationStorage
impl Borrow<NSUnit> for NSUnitInformationStorage
source§impl Borrow<NSUnit> for NSUnitLength
impl Borrow<NSUnit> for NSUnitLength
source§impl Borrow<NSUnit> for NSUnitMass
impl Borrow<NSUnit> for NSUnitMass
source§impl Borrow<NSUnit> for NSUnitPower
impl Borrow<NSUnit> for NSUnitPower
source§impl Borrow<NSUnit> for NSUnitPressure
impl Borrow<NSUnit> for NSUnitPressure
source§impl Borrow<NSUnit> for NSUnitSpeed
impl Borrow<NSUnit> for NSUnitSpeed
source§impl Borrow<NSUnit> for NSUnitTemperature
impl Borrow<NSUnit> for NSUnitTemperature
source§impl Borrow<NSUnit> for NSUnitVolume
impl Borrow<NSUnit> for NSUnitVolume
source§impl BorrowMut<AnyObject> for NSUnit
impl BorrowMut<AnyObject> for NSUnit
source§fn borrow_mut(&mut self) -> &mut AnyObject
fn borrow_mut(&mut self) -> &mut AnyObject
Mutably borrows from an owned value. Read more
source§impl BorrowMut<NSObject> for NSUnit
impl BorrowMut<NSObject> for NSUnit
source§fn borrow_mut(&mut self) -> &mut NSObject
fn borrow_mut(&mut self) -> &mut NSObject
Mutably borrows from an owned value. Read more
source§impl BorrowMut<NSUnit> for NSDimension
impl BorrowMut<NSUnit> for NSDimension
source§fn borrow_mut(&mut self) -> &mut NSUnit
fn borrow_mut(&mut self) -> &mut NSUnit
Mutably borrows from an owned value. Read more
source§impl BorrowMut<NSUnit> for NSUnitAcceleration
impl BorrowMut<NSUnit> for NSUnitAcceleration
source§fn borrow_mut(&mut self) -> &mut NSUnit
fn borrow_mut(&mut self) -> &mut NSUnit
Mutably borrows from an owned value. Read more
source§impl BorrowMut<NSUnit> for NSUnitAngle
impl BorrowMut<NSUnit> for NSUnitAngle
source§fn borrow_mut(&mut self) -> &mut NSUnit
fn borrow_mut(&mut self) -> &mut NSUnit
Mutably borrows from an owned value. Read more
source§impl BorrowMut<NSUnit> for NSUnitArea
impl BorrowMut<NSUnit> for NSUnitArea
source§fn borrow_mut(&mut self) -> &mut NSUnit
fn borrow_mut(&mut self) -> &mut NSUnit
Mutably borrows from an owned value. Read more
source§impl BorrowMut<NSUnit> for NSUnitConcentrationMass
impl BorrowMut<NSUnit> for NSUnitConcentrationMass
source§fn borrow_mut(&mut self) -> &mut NSUnit
fn borrow_mut(&mut self) -> &mut NSUnit
Mutably borrows from an owned value. Read more
source§impl BorrowMut<NSUnit> for NSUnitDispersion
impl BorrowMut<NSUnit> for NSUnitDispersion
source§fn borrow_mut(&mut self) -> &mut NSUnit
fn borrow_mut(&mut self) -> &mut NSUnit
Mutably borrows from an owned value. Read more
source§impl BorrowMut<NSUnit> for NSUnitDuration
impl BorrowMut<NSUnit> for NSUnitDuration
source§fn borrow_mut(&mut self) -> &mut NSUnit
fn borrow_mut(&mut self) -> &mut NSUnit
Mutably borrows from an owned value. Read more
source§impl BorrowMut<NSUnit> for NSUnitElectricCharge
impl BorrowMut<NSUnit> for NSUnitElectricCharge
source§fn borrow_mut(&mut self) -> &mut NSUnit
fn borrow_mut(&mut self) -> &mut NSUnit
Mutably borrows from an owned value. Read more
source§impl BorrowMut<NSUnit> for NSUnitElectricCurrent
impl BorrowMut<NSUnit> for NSUnitElectricCurrent
source§fn borrow_mut(&mut self) -> &mut NSUnit
fn borrow_mut(&mut self) -> &mut NSUnit
Mutably borrows from an owned value. Read more
source§impl BorrowMut<NSUnit> for NSUnitElectricPotentialDifference
impl BorrowMut<NSUnit> for NSUnitElectricPotentialDifference
source§fn borrow_mut(&mut self) -> &mut NSUnit
fn borrow_mut(&mut self) -> &mut NSUnit
Mutably borrows from an owned value. Read more
source§impl BorrowMut<NSUnit> for NSUnitElectricResistance
impl BorrowMut<NSUnit> for NSUnitElectricResistance
source§fn borrow_mut(&mut self) -> &mut NSUnit
fn borrow_mut(&mut self) -> &mut NSUnit
Mutably borrows from an owned value. Read more
source§impl BorrowMut<NSUnit> for NSUnitEnergy
impl BorrowMut<NSUnit> for NSUnitEnergy
source§fn borrow_mut(&mut self) -> &mut NSUnit
fn borrow_mut(&mut self) -> &mut NSUnit
Mutably borrows from an owned value. Read more
source§impl BorrowMut<NSUnit> for NSUnitFrequency
impl BorrowMut<NSUnit> for NSUnitFrequency
source§fn borrow_mut(&mut self) -> &mut NSUnit
fn borrow_mut(&mut self) -> &mut NSUnit
Mutably borrows from an owned value. Read more
source§impl BorrowMut<NSUnit> for NSUnitFuelEfficiency
impl BorrowMut<NSUnit> for NSUnitFuelEfficiency
source§fn borrow_mut(&mut self) -> &mut NSUnit
fn borrow_mut(&mut self) -> &mut NSUnit
Mutably borrows from an owned value. Read more
source§impl BorrowMut<NSUnit> for NSUnitIlluminance
impl BorrowMut<NSUnit> for NSUnitIlluminance
source§fn borrow_mut(&mut self) -> &mut NSUnit
fn borrow_mut(&mut self) -> &mut NSUnit
Mutably borrows from an owned value. Read more
source§impl BorrowMut<NSUnit> for NSUnitInformationStorage
impl BorrowMut<NSUnit> for NSUnitInformationStorage
source§fn borrow_mut(&mut self) -> &mut NSUnit
fn borrow_mut(&mut self) -> &mut NSUnit
Mutably borrows from an owned value. Read more
source§impl BorrowMut<NSUnit> for NSUnitLength
impl BorrowMut<NSUnit> for NSUnitLength
source§fn borrow_mut(&mut self) -> &mut NSUnit
fn borrow_mut(&mut self) -> &mut NSUnit
Mutably borrows from an owned value. Read more
source§impl BorrowMut<NSUnit> for NSUnitMass
impl BorrowMut<NSUnit> for NSUnitMass
source§fn borrow_mut(&mut self) -> &mut NSUnit
fn borrow_mut(&mut self) -> &mut NSUnit
Mutably borrows from an owned value. Read more
source§impl BorrowMut<NSUnit> for NSUnitPower
impl BorrowMut<NSUnit> for NSUnitPower
source§fn borrow_mut(&mut self) -> &mut NSUnit
fn borrow_mut(&mut self) -> &mut NSUnit
Mutably borrows from an owned value. Read more
source§impl BorrowMut<NSUnit> for NSUnitPressure
impl BorrowMut<NSUnit> for NSUnitPressure
source§fn borrow_mut(&mut self) -> &mut NSUnit
fn borrow_mut(&mut self) -> &mut NSUnit
Mutably borrows from an owned value. Read more
source§impl BorrowMut<NSUnit> for NSUnitSpeed
impl BorrowMut<NSUnit> for NSUnitSpeed
source§fn borrow_mut(&mut self) -> &mut NSUnit
fn borrow_mut(&mut self) -> &mut NSUnit
Mutably borrows from an owned value. Read more
source§impl BorrowMut<NSUnit> for NSUnitTemperature
impl BorrowMut<NSUnit> for NSUnitTemperature
source§fn borrow_mut(&mut self) -> &mut NSUnit
fn borrow_mut(&mut self) -> &mut NSUnit
Mutably borrows from an owned value. Read more
source§impl BorrowMut<NSUnit> for NSUnitVolume
impl BorrowMut<NSUnit> for NSUnitVolume
source§fn borrow_mut(&mut self) -> &mut NSUnit
fn borrow_mut(&mut self) -> &mut NSUnit
Mutably borrows from an owned value. Read more
source§impl ClassType for NSUnit
impl ClassType for NSUnit
§type Mutability = InteriorMutable
type Mutability = InteriorMutable
Whether the type is mutable or immutable. Read more
source§const NAME: &'static str = "NSUnit"
const NAME: &'static str = "NSUnit"
The name of the Objective-C class that this type represents. Read more
source§fn class() -> &'static AnyClass
fn class() -> &'static AnyClass
Get a reference to the Objective-C class that this type represents. Read more
source§fn as_super_mut(&mut self) -> &mut Self::Super
fn as_super_mut(&mut self) -> &mut Self::Super
Get a mutable reference to the superclass.
source§impl NSCopying for NSUnit
Available on crate feature NSObject
only.
impl NSCopying for NSUnit
Available on crate feature
NSObject
only.source§impl NSObjectProtocol for NSUnit
impl NSObjectProtocol for NSUnit
source§fn isEqual(&self, other: &AnyObject) -> bool
fn isEqual(&self, other: &AnyObject) -> bool
Check whether the object is equal to an arbitrary other object. Read more
source§fn hash(&self) -> usize
fn hash(&self) -> usize
An integer that can be used as a table address in a hash table
structure. Read more
source§fn isKindOfClass(&self, cls: &AnyClass) -> bool
fn isKindOfClass(&self, cls: &AnyClass) -> bool
Check if the object is an instance of the class, or one of its
subclasses. Read more
source§fn is_kind_of<T>(&self) -> bool
fn is_kind_of<T>(&self) -> bool
Check if the object is an instance of the class type, or one of its
subclasses. Read more
source§fn isMemberOfClass(&self, cls: &AnyClass) -> bool
fn isMemberOfClass(&self, cls: &AnyClass) -> bool
Check if the object is an instance of a specific class, without
checking subclasses. Read more
source§fn respondsToSelector(&self, aSelector: Sel) -> bool
fn respondsToSelector(&self, aSelector: Sel) -> bool
Check whether the object implements or inherits a method with the
given selector. Read more
source§fn conformsToProtocol(&self, aProtocol: &AnyProtocol) -> bool
fn conformsToProtocol(&self, aProtocol: &AnyProtocol) -> bool
Check whether the object conforms to a given protocol. Read more
source§fn debugDescription(&self) -> Retained<NSObject>
fn debugDescription(&self) -> Retained<NSObject>
A textual representation of the object to use when debugging. Read more
source§impl NSSecureCoding for NSUnit
Available on crate feature NSObject
only.
impl NSSecureCoding for NSUnit
Available on crate feature
NSObject
only.source§impl PartialEq for NSUnit
impl PartialEq for NSUnit
source§impl RefEncode for NSUnit
impl RefEncode for NSUnit
source§const ENCODING_REF: Encoding = <NSObject as ::objc2::RefEncode>::ENCODING_REF
const ENCODING_REF: Encoding = <NSObject as ::objc2::RefEncode>::ENCODING_REF
The Objective-C type-encoding for a reference of this type. Read more
impl Eq for NSUnit
impl Message for NSUnit
impl StructuralPartialEq for NSUnit
Auto Trait Implementations§
impl !Freeze for NSUnit
impl !RefUnwindSafe for NSUnit
impl !Send for NSUnit
impl !Sync for NSUnit
impl !Unpin for NSUnit
impl !UnwindSafe for NSUnit
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CounterpartOrSelf for T
impl<T> CounterpartOrSelf for T
§type Immutable = <<T as ClassType>::Mutability as MutabilityCounterpartOrSelf<T>>::Immutable
type Immutable = <<T as ClassType>::Mutability as MutabilityCounterpartOrSelf<T>>::Immutable
The immutable counterpart of the type, or
Self
if the type has no
immutable counterpart. Read more§type Mutable = <<T as ClassType>::Mutability as MutabilityCounterpartOrSelf<T>>::Mutable
type Mutable = <<T as ClassType>::Mutability as MutabilityCounterpartOrSelf<T>>::Mutable
The mutable counterpart of the type, or
Self
if the type has no
mutable counterpart. Read more