Trait objc2_foundation::NSCopying

source ·
pub unsafe trait NSCopying {
    // Provided methods
    fn copy(&self) -> Id<Self::Immutable>
       where Self: Sized + Message + CounterpartOrSelf { ... }
    unsafe fn copyWithZone(&self, zone: *mut NSZone) -> Id<Self::Immutable>
       where Self: Sized + Message + CounterpartOrSelf { ... }
}
Available on crate feature NSObject only.
Expand description

A protocol to provide functional copies of objects.

This is similar to Rust’s Clone trait, along with sharing a few similarities to the std::borrow::ToOwned trait with regards to the output type.

See Apple’s documentation for details.

Provided Methods§

source

fn copy(&self) -> Id<Self::Immutable>

Returns a new instance that’s a copy of the receiver.

The output type is the immutable counterpart of the object, which is usually Self, but e.g. NSMutableString returns NSString.

source

unsafe fn copyWithZone(&self, zone: *mut NSZone) -> Id<Self::Immutable>

Available on crate feature NSZone only.

Returns a new instance that’s a copy of the receiver.

This is only used when implementing NSCopying, use copy instead.

§Safety

The zone pointer must be valid or NULL.

Trait Implementations§

source§

impl ProtocolType for dyn NSCopying

source§

const NAME: &'static str = "NSCopying"

The name of the Objective-C protocol that this type represents.
source§

fn protocol() -> Option<&'static AnyProtocol>

Get a reference to the Objective-C protocol object that this type represents. Read more
source§

impl<T> ImplementedBy<T> for dyn NSCopying
where T: ?Sized + Message + NSCopying,

Implementations on Foreign Types§

source§

impl<T> NSCopying for ProtocolObject<T>
where T: ?Sized + NSCopying,

Implementors§

source§

impl NSCopying for NSAffineTransform

Available on crate feature NSAffineTransform only.
source§

impl NSCopying for NSAppleEventDescriptor

Available on crate feature NSAppleEventDescriptor only.
source§

impl NSCopying for NSAppleScript

Available on crate feature NSAppleScript only.
source§

impl NSCopying for NSAttributedString

Available on crate feature NSAttributedString only.
source§

impl NSCopying for NSAttributedStringMarkdownParsingOptions

Available on crate feature NSAttributedString only.
source§

impl NSCopying for NSAttributedStringMarkdownSourcePosition

Available on crate feature NSAttributedString only.
source§

impl NSCopying for NSByteCountFormatter

Available on crate features NSFormatter and NSByteCountFormatter only.
source§

impl NSCopying for NSCachedURLResponse

Available on crate feature NSURLCache only.
source§

impl NSCopying for NSCalendar

Available on crate feature NSCalendar only.
source§

impl NSCopying for NSCalendarDate

Available on crate features NSDate and NSCalendarDate only.
source§

impl NSCopying for NSCharacterSet

Available on crate feature NSCharacterSet only.
source§

impl NSCopying for NSComparisonPredicate

Available on crate features NSPredicate and NSComparisonPredicate only.
source§

impl NSCopying for NSCompoundPredicate

Available on crate features NSPredicate and NSCompoundPredicate only.
source§

impl NSCopying for NSData

Available on crate feature NSData only.
source§

impl NSCopying for NSDataDetector

Available on crate feature NSRegularExpression only.
source§

impl NSCopying for NSDate

Available on crate feature NSDate only.
source§

impl NSCopying for NSDateComponents

Available on crate feature NSCalendar only.
source§

impl NSCopying for NSDateComponentsFormatter

Available on crate features NSFormatter and NSDateComponentsFormatter only.
source§

impl NSCopying for NSDateFormatter

Available on crate features NSFormatter and NSDateFormatter only.
source§

impl NSCopying for NSDateInterval

Available on crate feature NSDateInterval only.
source§

impl NSCopying for NSDateIntervalFormatter

Available on crate features NSFormatter and NSDateIntervalFormatter only.
source§

impl NSCopying for NSDecimalNumber

Available on crate features NSValue and NSDecimalNumber only.
source§

impl NSCopying for NSDimension

Available on crate feature NSUnit only.
source§

impl NSCopying for NSEnergyFormatter

Available on crate features NSFormatter and NSEnergyFormatter only.
source§

impl NSCopying for NSError

Available on crate feature NSError only.
source§

impl NSCopying for NSException

Available on crate feature NSException only.
source§

impl NSCopying for NSExpression

Available on crate feature NSExpression only.
source§

impl NSCopying for NSExtensionItem

Available on crate feature NSExtensionItem only.
source§

impl NSCopying for NSFileSecurity

Available on crate feature NSURL only.
source§

impl NSCopying for NSFormatter

Available on crate feature NSFormatter only.
source§

impl NSCopying for NSHTTPURLResponse

Available on crate feature NSURLResponse only.
source§

impl NSCopying for NSISO8601DateFormatter

Available on crate features NSFormatter and NSISO8601DateFormatter only.
source§

impl NSCopying for NSIndexPath

Available on crate feature NSIndexPath only.
source§

impl NSCopying for NSIndexSet

Available on crate feature NSIndexSet only.
source§

impl NSCopying for NSInflectionRule

Available on crate feature NSInflectionRule only.
source§

impl NSCopying for NSInflectionRuleExplicit

Available on crate feature NSInflectionRule only.
source§

impl NSCopying for NSItemProvider

Available on crate feature NSItemProvider only.
source§

impl NSCopying for NSLengthFormatter

Available on crate features NSFormatter and NSLengthFormatter only.
source§

impl NSCopying for NSListFormatter

Available on crate features NSFormatter and NSListFormatter only.
source§

impl NSCopying for NSLocale

Available on crate feature NSLocale only.
source§

impl NSCopying for NSMachPort

Available on crate feature NSPort only.
source§

impl NSCopying for NSMassFormatter

Available on crate features NSFormatter and NSMassFormatter only.
source§

impl NSCopying for NSMeasurementFormatter

Available on crate features NSFormatter and NSMeasurementFormatter only.
source§

impl NSCopying for NSMessagePort

Available on crate feature NSPort only.
source§

impl NSCopying for NSMorphology

Available on crate feature NSMorphology only.
source§

impl NSCopying for NSMorphologyCustomPronoun

Available on crate feature NSMorphology only.
source§

impl NSCopying for NSMorphologyPronoun

Available on crate feature NSMorphology only.
source§

impl NSCopying for NSMutableAttributedString

Available on crate feature NSAttributedString only.
source§

impl NSCopying for NSMutableCharacterSet

Available on crate feature NSCharacterSet only.
source§

impl NSCopying for NSMutableData

Available on crate feature NSData only.
source§

impl NSCopying for NSMutableIndexSet

Available on crate feature NSIndexSet only.
source§

impl NSCopying for NSMutableString

Available on crate feature NSString only.
source§

impl NSCopying for NSMutableURLRequest

Available on crate feature NSURLRequest only.
source§

impl NSCopying for NSNotification

Available on crate feature NSNotification only.
source§

impl NSCopying for NSNull

Available on crate feature NSNull only.
source§

impl NSCopying for NSNumber

Available on crate feature NSValue only.
source§

impl NSCopying for NSNumberFormatter

Available on crate features NSFormatter and NSNumberFormatter only.
source§

impl NSCopying for NSOrthography

Available on crate feature NSOrthography only.
source§

impl NSCopying for NSPersonNameComponents

Available on crate feature NSPersonNameComponents only.
source§

impl NSCopying for NSPersonNameComponentsFormatter

Available on crate features NSFormatter and NSPersonNameComponentsFormatter only.
source§

impl NSCopying for NSPointerArray

Available on crate feature NSPointerArray only.
source§

impl NSCopying for NSPointerFunctions

Available on crate feature NSPointerFunctions only.
source§

impl NSCopying for NSPort

Available on crate feature NSPort only.
source§

impl NSCopying for NSPredicate

Available on crate feature NSPredicate only.
source§

impl NSCopying for NSPresentationIntent

Available on crate feature NSAttributedString only.
source§

impl NSCopying for NSRegularExpression

Available on crate feature NSRegularExpression only.
source§

impl NSCopying for NSRelativeDateTimeFormatter

Available on crate features NSFormatter and NSRelativeDateTimeFormatter only.
source§

impl NSCopying for NSScanner

Available on crate feature NSScanner only.
source§

impl NSCopying for NSSocketPort

Available on crate feature NSPort only.
source§

impl NSCopying for NSSortDescriptor

Available on crate feature NSSortDescriptor only.
source§

impl NSCopying for NSString

Available on crate feature NSString only.
source§

impl NSCopying for NSTermOfAddress

Available on crate feature NSTermOfAddress only.
source§

impl NSCopying for NSTextCheckingResult

Available on crate feature NSTextCheckingResult only.
source§

impl NSCopying for NSTimeZone

Available on crate feature NSTimeZone only.
source§

impl NSCopying for NSURL

Available on crate feature NSURL only.
source§

impl NSCopying for NSURLComponents

Available on crate feature NSURL only.
source§

impl NSCopying for NSURLCredential

Available on crate feature NSURLCredential only.
source§

impl NSCopying for NSURLProtectionSpace

Available on crate feature NSURLProtectionSpace only.
source§

impl NSCopying for NSURLQueryItem

Available on crate feature NSURL only.
source§

impl NSCopying for NSURLRequest

Available on crate feature NSURLRequest only.
source§

impl NSCopying for NSURLResponse

Available on crate feature NSURLResponse only.
source§

impl NSCopying for NSURLSessionConfiguration

Available on crate feature NSURLSession only.
source§

impl NSCopying for NSURLSessionDataTask

Available on crate feature NSURLSession only.
source§

impl NSCopying for NSURLSessionDownloadTask

Available on crate feature NSURLSession only.
source§

impl NSCopying for NSURLSessionStreamTask

Available on crate feature NSURLSession only.
source§

impl NSCopying for NSURLSessionTask

Available on crate feature NSURLSession only.
source§

impl NSCopying for NSURLSessionUploadTask

Available on crate feature NSURLSession only.
source§

impl NSCopying for NSURLSessionWebSocketTask

Available on crate feature NSURLSession only.
source§

impl NSCopying for NSUUID

Available on crate feature NSUUID only.
source§

impl NSCopying for NSUnit

Available on crate feature NSUnit only.
source§

impl NSCopying for NSUnitAcceleration

Available on crate feature NSUnit only.
source§

impl NSCopying for NSUnitAngle

Available on crate feature NSUnit only.
source§

impl NSCopying for NSUnitArea

Available on crate feature NSUnit only.
source§

impl NSCopying for NSUnitConcentrationMass

Available on crate feature NSUnit only.
source§

impl NSCopying for NSUnitDispersion

Available on crate feature NSUnit only.
source§

impl NSCopying for NSUnitDuration

Available on crate feature NSUnit only.
source§

impl NSCopying for NSUnitElectricCharge

Available on crate feature NSUnit only.
source§

impl NSCopying for NSUnitElectricCurrent

Available on crate feature NSUnit only.
source§

impl NSCopying for NSUnitElectricPotentialDifference

Available on crate feature NSUnit only.
source§

impl NSCopying for NSUnitElectricResistance

Available on crate feature NSUnit only.
source§

impl NSCopying for NSUnitEnergy

Available on crate feature NSUnit only.
source§

impl NSCopying for NSUnitFrequency

Available on crate feature NSUnit only.
source§

impl NSCopying for NSUnitFuelEfficiency

Available on crate feature NSUnit only.
source§

impl NSCopying for NSUnitIlluminance

Available on crate feature NSUnit only.
source§

impl NSCopying for NSUnitInformationStorage

Available on crate feature NSUnit only.
source§

impl NSCopying for NSUnitLength

Available on crate feature NSUnit only.
source§

impl NSCopying for NSUnitMass

Available on crate feature NSUnit only.
source§

impl NSCopying for NSUnitPower

Available on crate feature NSUnit only.
source§

impl NSCopying for NSUnitPressure

Available on crate feature NSUnit only.
source§

impl NSCopying for NSUnitSpeed

Available on crate feature NSUnit only.
source§

impl NSCopying for NSUnitTemperature

Available on crate feature NSUnit only.
source§

impl NSCopying for NSUnitVolume

Available on crate feature NSUnit only.
source§

impl NSCopying for NSUserNotification

Available on crate feature NSUserNotification only.
source§

impl NSCopying for NSUserNotificationAction

Available on crate feature NSUserNotification only.
source§

impl NSCopying for NSValue

Available on crate feature NSValue only.
source§

impl NSCopying for NSXMLDTD

Available on crate features NSXMLNode and NSXMLDTD only.
source§

impl NSCopying for NSXMLDTDNode

Available on crate features NSXMLNode and NSXMLDTDNode only.
source§

impl NSCopying for NSXMLDocument

Available on crate features NSXMLNode and NSXMLDocument only.
source§

impl NSCopying for NSXMLElement

Available on crate features NSXMLNode and NSXMLElement only.
source§

impl NSCopying for NSXMLNode

Available on crate feature NSXMLNode only.
source§

impl<KeyType: ?Sized + IsIdCloneable, ObjectType: ?Sized + IsIdCloneable> NSCopying for NSDictionary<KeyType, ObjectType>

Available on crate feature NSDictionary only.
source§

impl<KeyType: ?Sized + IsIdCloneable, ObjectType: ?Sized + IsIdCloneable> NSCopying for NSMapTable<KeyType, ObjectType>

Available on crate feature NSMapTable only.
source§

impl<KeyType: ?Sized + IsIdCloneable, ObjectType: ?Sized + IsIdCloneable> NSCopying for NSMutableDictionary<KeyType, ObjectType>

Available on crate feature NSDictionary only.
source§

impl<ObjectType: ?Sized + IsIdCloneable> NSCopying for NSArray<ObjectType>

Available on crate feature NSArray only.
source§

impl<ObjectType: ?Sized + IsIdCloneable> NSCopying for NSCountedSet<ObjectType>

Available on crate feature NSSet only.
source§

impl<ObjectType: ?Sized + IsIdCloneable> NSCopying for NSHashTable<ObjectType>

Available on crate feature NSHashTable only.
source§

impl<ObjectType: ?Sized + IsIdCloneable> NSCopying for NSMutableArray<ObjectType>

Available on crate feature NSArray only.
source§

impl<ObjectType: ?Sized + IsIdCloneable> NSCopying for NSMutableOrderedSet<ObjectType>

Available on crate feature NSOrderedSet only.
source§

impl<ObjectType: ?Sized + IsIdCloneable> NSCopying for NSMutableSet<ObjectType>

Available on crate feature NSSet only.
source§

impl<ObjectType: ?Sized + IsIdCloneable> NSCopying for NSOrderedSet<ObjectType>

Available on crate feature NSOrderedSet only.
source§

impl<ObjectType: ?Sized + IsIdCloneable> NSCopying for NSSet<ObjectType>

Available on crate feature NSSet only.
source§

impl<UnitType: ?Sized + IsIdCloneable> NSCopying for NSMeasurement<UnitType>

Available on crate feature NSMeasurement only.