Trait CopyingHelper

Source
pub unsafe trait CopyingHelper: Message {
    type Result: Message;
}
Available on crate feature NSObject only.
Expand description

A helper type for implementing NSCopying.

NSCopying and NSMutableCopying do not in their signatures describe the result type from the copying operation. This is problematic, as it means that using them ends up falling back to AnyObject, which makes copying much less useful and ergonomic.

To properly describe this, we need an associated type which describes the actual result type from a copy. The associated type can’t be present directly on the protocol traits themselves, however, since we want to use them as e.g. ProtocolObject<dyn NSCopying>, so we introduce this helper trait instead. See MutableCopyingHelper for the mutable variant.

We might be able to get rid of this hack once associated type defaults are stabilized.

§Safety

The Result type must be correct.

Required Associated Types§

Source

type Result: Message

The immutable counterpart of the type, or Self if the type has no immutable counterpart.

The implementation for NSString has itself (NSString) here, while NSMutableString instead has NSString.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<P: ?Sized> CopyingHelper for ProtocolObject<P>

Implementors§

Source§

impl CopyingHelper for NSAffineTransform

Available on crate feature NSAffineTransform only.
Source§

impl CopyingHelper for NSAppleEventDescriptor

Available on crate feature NSAppleEventDescriptor only.
Source§

impl CopyingHelper for NSAppleScript

Available on crate feature NSAppleScript only.
Source§

impl CopyingHelper for NSAttributedString

Available on crate feature NSAttributedString only.
Source§

impl CopyingHelper for NSAttributedStringMarkdownParsingOptions

Available on crate feature NSAttributedString only.
Source§

impl CopyingHelper for NSAttributedStringMarkdownSourcePosition

Available on crate feature NSAttributedString only.
Source§

impl CopyingHelper for NSByteCountFormatter

Available on crate features NSFormatter and NSByteCountFormatter only.
Source§

impl CopyingHelper for NSCachedURLResponse

Available on crate feature NSURLCache only.
Source§

impl CopyingHelper for NSCalendar

Available on crate feature NSCalendar only.
Source§

impl CopyingHelper for NSCalendarDate

Available on crate features NSDate and NSCalendarDate only.
Source§

impl CopyingHelper for NSCharacterSet

Available on crate feature NSCharacterSet only.
Source§

impl CopyingHelper for NSComparisonPredicate

Available on crate features NSPredicate and NSComparisonPredicate only.
Source§

impl CopyingHelper for NSCompoundPredicate

Available on crate features NSPredicate and NSCompoundPredicate only.
Source§

impl CopyingHelper for NSData

Available on crate feature NSData only.
Source§

impl CopyingHelper for NSDataDetector

Available on crate feature NSRegularExpression only.
Source§

impl CopyingHelper for NSDate

Available on crate feature NSDate only.
Source§

impl CopyingHelper for NSDateComponents

Available on crate feature NSCalendar only.
Source§

impl CopyingHelper for NSDateComponentsFormatter

Available on crate features NSFormatter and NSDateComponentsFormatter only.
Source§

impl CopyingHelper for NSDateFormatter

Available on crate features NSFormatter and NSDateFormatter only.
Source§

impl CopyingHelper for NSDateInterval

Available on crate feature NSDateInterval only.
Source§

impl CopyingHelper for NSDateIntervalFormatter

Available on crate features NSFormatter and NSDateIntervalFormatter only.
Source§

impl CopyingHelper for NSDecimalNumber

Available on crate features NSValue and NSDecimalNumber only.
Source§

impl CopyingHelper for NSDimension

Available on crate feature NSUnit only.
Source§

impl CopyingHelper for NSEnergyFormatter

Available on crate features NSFormatter and NSEnergyFormatter only.
Source§

impl CopyingHelper for NSError

Available on crate feature NSError only.
Source§

impl CopyingHelper for NSException

Available on crate feature NSException only.
Source§

impl CopyingHelper for NSExpression

Available on crate feature NSExpression only.
Source§

impl CopyingHelper for NSExtensionItem

Available on crate feature NSExtensionItem only.
Source§

impl CopyingHelper for NSFileSecurity

Available on crate feature NSURL only.
Source§

impl CopyingHelper for NSFormatter

Available on crate feature NSFormatter only.
Source§

impl CopyingHelper for NSHTTPURLResponse

Available on crate feature NSURLResponse only.
Source§

impl CopyingHelper for NSISO8601DateFormatter

Available on crate features NSFormatter and NSISO8601DateFormatter only.
Source§

impl CopyingHelper for NSIndexPath

Available on crate feature NSIndexPath only.
Source§

impl CopyingHelper for NSIndexSet

Available on crate feature NSIndexSet only.
Source§

impl CopyingHelper for NSInflectionRule

Available on crate feature NSInflectionRule only.
Source§

impl CopyingHelper for NSInflectionRuleExplicit

Available on crate feature NSInflectionRule only.
Source§

impl CopyingHelper for NSItemProvider

Available on crate feature NSItemProvider only.
Source§

impl CopyingHelper for NSLengthFormatter

Available on crate features NSFormatter and NSLengthFormatter only.
Source§

impl CopyingHelper for NSListFormatter

Available on crate features NSFormatter and NSListFormatter only.
Source§

impl CopyingHelper for NSLocale

Available on crate feature NSLocale only.
Source§

impl CopyingHelper for NSLocalizedNumberFormatRule

Available on crate feature NSLocalizedNumberFormatRule only.
Source§

impl CopyingHelper for NSMachPort

Available on crate feature NSPort only.
Source§

impl CopyingHelper for NSMassFormatter

Available on crate features NSFormatter and NSMassFormatter only.
Source§

impl CopyingHelper for NSMeasurementFormatter

Available on crate features NSFormatter and NSMeasurementFormatter only.
Source§

impl CopyingHelper for NSMessagePort

Available on crate feature NSPort only.
Source§

impl CopyingHelper for NSMorphology

Available on crate feature NSMorphology only.
Source§

impl CopyingHelper for NSMorphologyCustomPronoun

Available on crate feature NSMorphology only.
Source§

impl CopyingHelper for NSMorphologyPronoun

Available on crate feature NSMorphology only.
Source§

impl CopyingHelper for NSMutableAttributedString

Available on crate feature NSAttributedString only.
Source§

impl CopyingHelper for NSMutableCharacterSet

Available on crate feature NSCharacterSet only.
Source§

impl CopyingHelper for NSMutableData

Available on crate feature NSData only.
Source§

impl CopyingHelper for NSMutableIndexSet

Available on crate feature NSIndexSet only.
Source§

impl CopyingHelper for NSMutableString

Available on crate feature NSString only.
Source§

impl CopyingHelper for NSMutableURLRequest

Available on crate feature NSURLRequest only.
Source§

impl CopyingHelper for NSNotification

Available on crate feature NSNotification only.
Source§

impl CopyingHelper for NSNull

Available on crate feature NSNull only.
Source§

impl CopyingHelper for NSNumber

Available on crate feature NSValue only.
Source§

impl CopyingHelper for NSNumberFormatter

Available on crate features NSFormatter and NSNumberFormatter only.
Source§

impl CopyingHelper for NSOrthography

Available on crate feature NSOrthography only.
Source§

impl CopyingHelper for NSPersonNameComponents

Available on crate feature NSPersonNameComponents only.
Source§

impl CopyingHelper for NSPersonNameComponentsFormatter

Available on crate features NSFormatter and NSPersonNameComponentsFormatter only.
Source§

impl CopyingHelper for NSPointerArray

Available on crate feature NSPointerArray only.
Source§

impl CopyingHelper for NSPointerFunctions

Available on crate feature NSPointerFunctions only.
Source§

impl CopyingHelper for NSPort

Available on crate feature NSPort only.
Source§

impl CopyingHelper for NSPredicate

Available on crate feature NSPredicate only.
Source§

impl CopyingHelper for NSPresentationIntent

Available on crate feature NSAttributedString only.
Source§

impl CopyingHelper for NSRegularExpression

Available on crate feature NSRegularExpression only.
Source§

impl CopyingHelper for NSRelativeDateTimeFormatter

Available on crate features NSFormatter and NSRelativeDateTimeFormatter only.
Source§

impl CopyingHelper for NSScanner

Available on crate feature NSScanner only.
Source§

impl CopyingHelper for NSSocketPort

Available on crate feature NSPort only.
Source§

impl CopyingHelper for NSSortDescriptor

Available on crate feature NSSortDescriptor only.
Source§

impl CopyingHelper for NSString

Available on crate feature NSString only.
Source§

impl CopyingHelper for NSTermOfAddress

Available on crate feature NSTermOfAddress only.
Source§

impl CopyingHelper for NSTextCheckingResult

Available on crate feature NSTextCheckingResult only.
Source§

impl CopyingHelper for NSTimeZone

Available on crate feature NSTimeZone only.
Source§

impl CopyingHelper for NSURL

Available on crate feature NSURL only.
Source§

impl CopyingHelper for NSURLComponents

Available on crate feature NSURL only.
Source§

impl CopyingHelper for NSURLCredential

Available on crate feature NSURLCredential only.
Source§

impl CopyingHelper for NSURLProtectionSpace

Available on crate feature NSURLProtectionSpace only.
Source§

impl CopyingHelper for NSURLQueryItem

Available on crate feature NSURL only.
Source§

impl CopyingHelper for NSURLRequest

Available on crate feature NSURLRequest only.
Source§

impl CopyingHelper for NSURLResponse

Available on crate feature NSURLResponse only.
Source§

impl CopyingHelper for NSURLSessionConfiguration

Available on crate feature NSURLSession only.
Source§

impl CopyingHelper for NSURLSessionDataTask

Available on crate feature NSURLSession only.
Source§

impl CopyingHelper for NSURLSessionDownloadTask

Available on crate feature NSURLSession only.
Source§

impl CopyingHelper for NSURLSessionStreamTask

Available on crate feature NSURLSession only.
Source§

impl CopyingHelper for NSURLSessionTask

Available on crate feature NSURLSession only.
Source§

impl CopyingHelper for NSURLSessionUploadTask

Available on crate feature NSURLSession only.
Source§

impl CopyingHelper for NSURLSessionWebSocketTask

Available on crate feature NSURLSession only.
Source§

impl CopyingHelper for NSUUID

Available on crate feature NSUUID only.
Source§

impl CopyingHelper for NSUnit

Available on crate feature NSUnit only.
Source§

impl CopyingHelper for NSUnitAcceleration

Available on crate feature NSUnit only.
Source§

impl CopyingHelper for NSUnitAngle

Available on crate feature NSUnit only.
Source§

impl CopyingHelper for NSUnitArea

Available on crate feature NSUnit only.
Source§

impl CopyingHelper for NSUnitConcentrationMass

Available on crate feature NSUnit only.
Source§

impl CopyingHelper for NSUnitDispersion

Available on crate feature NSUnit only.
Source§

impl CopyingHelper for NSUnitDuration

Available on crate feature NSUnit only.
Source§

impl CopyingHelper for NSUnitElectricCharge

Available on crate feature NSUnit only.
Source§

impl CopyingHelper for NSUnitElectricCurrent

Available on crate feature NSUnit only.
Source§

impl CopyingHelper for NSUnitElectricPotentialDifference

Available on crate feature NSUnit only.
Source§

impl CopyingHelper for NSUnitElectricResistance

Available on crate feature NSUnit only.
Source§

impl CopyingHelper for NSUnitEnergy

Available on crate feature NSUnit only.
Source§

impl CopyingHelper for NSUnitFrequency

Available on crate feature NSUnit only.
Source§

impl CopyingHelper for NSUnitFuelEfficiency

Available on crate feature NSUnit only.
Source§

impl CopyingHelper for NSUnitIlluminance

Available on crate feature NSUnit only.
Source§

impl CopyingHelper for NSUnitInformationStorage

Available on crate feature NSUnit only.
Source§

impl CopyingHelper for NSUnitLength

Available on crate feature NSUnit only.
Source§

impl CopyingHelper for NSUnitMass

Available on crate feature NSUnit only.
Source§

impl CopyingHelper for NSUnitPower

Available on crate feature NSUnit only.
Source§

impl CopyingHelper for NSUnitPressure

Available on crate feature NSUnit only.
Source§

impl CopyingHelper for NSUnitSpeed

Available on crate feature NSUnit only.
Source§

impl CopyingHelper for NSUnitTemperature

Available on crate feature NSUnit only.
Source§

impl CopyingHelper for NSUnitVolume

Available on crate feature NSUnit only.
Source§

impl CopyingHelper for NSUserNotification

Available on crate feature NSUserNotification only.
Source§

impl CopyingHelper for NSUserNotificationAction

Available on crate feature NSUserNotification only.
Source§

impl CopyingHelper for NSValue

Available on crate feature NSValue only.
Source§

impl CopyingHelper for NSXMLDTD

Available on crate features NSXMLNode and NSXMLDTD only.
Source§

impl CopyingHelper for NSXMLDTDNode

Available on crate features NSXMLNode and NSXMLDTDNode only.
Source§

impl CopyingHelper for NSXMLDocument

Available on crate features NSXMLNode and NSXMLDocument only.
Source§

impl CopyingHelper for NSXMLElement

Available on crate features NSXMLNode and NSXMLElement only.
Source§

impl CopyingHelper for NSXMLNode

Available on crate feature NSXMLNode only.
Source§

impl<KeyType: ?Sized + Message, ObjectType: ?Sized + Message> CopyingHelper for NSDictionary<KeyType, ObjectType>

Available on crate feature NSDictionary only.
Source§

type Result = NSDictionary<KeyType, ObjectType>

Source§

impl<KeyType: ?Sized + Message, ObjectType: ?Sized + Message> CopyingHelper for NSMapTable<KeyType, ObjectType>

Available on crate feature NSMapTable only.
Source§

type Result = NSMapTable<KeyType, ObjectType>

Source§

impl<KeyType: ?Sized + Message, ObjectType: ?Sized + Message> CopyingHelper for NSMutableDictionary<KeyType, ObjectType>

Available on crate feature NSDictionary only.
Source§

type Result = NSDictionary<KeyType, ObjectType>

Source§

impl<ObjectType: ?Sized + Message> CopyingHelper for NSArray<ObjectType>

Available on crate feature NSArray only.
Source§

type Result = NSArray<ObjectType>

Source§

impl<ObjectType: ?Sized + Message> CopyingHelper for NSHashTable<ObjectType>

Available on crate feature NSHashTable only.
Source§

type Result = NSHashTable<ObjectType>

Source§

impl<ObjectType: ?Sized + Message> CopyingHelper for NSMutableArray<ObjectType>

Available on crate feature NSArray only.
Source§

type Result = NSArray<ObjectType>

Source§

impl<ObjectType: ?Sized + Message> CopyingHelper for NSMutableOrderedSet<ObjectType>

Available on crate feature NSOrderedSet only.
Source§

type Result = NSOrderedSet<ObjectType>

Source§

impl<ObjectType: ?Sized + Message> CopyingHelper for NSMutableSet<ObjectType>

Available on crate feature NSSet only.
Source§

type Result = NSSet<ObjectType>

Source§

impl<ObjectType: ?Sized + Message> CopyingHelper for NSOrderedSet<ObjectType>

Available on crate feature NSOrderedSet only.
Source§

type Result = NSOrderedSet<ObjectType>

Source§

impl<ObjectType: ?Sized + Message> CopyingHelper for NSSet<ObjectType>

Available on crate feature NSSet only.
Source§

type Result = NSSet<ObjectType>

Source§

impl<UnitType: ?Sized + Message> CopyingHelper for NSMeasurement<UnitType>

Available on crate feature NSMeasurement only.
Source§

type Result = NSMeasurement<UnitType>