NSImage

Struct NSImage 

Source
pub struct NSImage { /* private fields */ }
Available on crate feature NSImage only.
Expand description

Implementations§

Source§

impl NSImage

Source

pub fn imageNamed(name: &NSImageName) -> Option<Retained<NSImage>>

Source

pub fn imageWithSystemSymbolName_accessibilityDescription( name: &NSString, description: Option<&NSString>, ) -> Option<Retained<Self>>

Creates a system symbol image with the specified name and value

Parameter name: A name from the system’s SF Symbols catalog

Parameter description: The image’s accessibility description. This description is used automatically by interface elements that display images. Like all accessibility descriptions, use a short localized string that does not include the name of the interface element. For instance, “delete” rather than “delete button”.

Source

pub fn imageWithSystemSymbolName_variableValue_accessibilityDescription( name: &NSString, value: c_double, description: Option<&NSString>, ) -> Option<Retained<Self>>

Creates a system symbol image with the specified name and value. The valueargument is only accommodated if the symbol supports variable rendering.

Parameter name: A name from the system’s SF Symbols catalog

Parameter value: The value represented by the symbol. The value should be between 0 and 1 inclusive ([0,1]).

Parameter description: The image’s accessibility description. This description is used automatically by interface elements that display images. Like all accessibility descriptions, use a short localized string that does not include the name of the interface element. For instance, “delete” rather than “delete button”.

Note: Values less than 0 or greater than 1 will be clamped to 0 and 1, respectively.

Source

pub fn imageWithSymbolName_variableValue( name: &NSString, value: c_double, ) -> Option<Retained<Self>>

Creates a symbol image with the specified name and value. The valueargument is only accommodated if the symbol supports variable rendering.

Parameter name: A name of a symbol image file in the main bundle’s catalog

Parameter value: The value represented by the symbol. The value should be between 0 and 1 inclusive ([0,1]).

Note: Values less than 0 or greater than 1 will be clamped to 0 and 1, respectively.

Source

pub fn imageWithSymbolName_bundle_variableValue( name: &NSString, bundle: Option<&NSBundle>, value: c_double, ) -> Option<Retained<Self>>

Creates a symbol image with the specified name and value. The valueargument is only accommodated if the symbol supports variable rendering.

Parameter name: A name of a symbol image file in the main bundle’s catalog

Parameter bundle: The bundle containing the image file or asset catalog. Specify nil to search the app’s main bundle.

Parameter value: The value represented by the symbol. The value should be between 0 and 1 inclusive ([0,1]).

Note: Values less than 0 or greater than 1 will be clamped to 0 and 1, respectively.

Source

pub fn initWithSize(this: Allocated<Self>, size: NSSize) -> Retained<Self>

Source

pub unsafe fn initWithCoder( this: Allocated<Self>, coder: &NSCoder, ) -> Retained<Self>

§Safety

coder possibly has further requirements.

Source

pub fn initWithData( this: Allocated<Self>, data: &NSData, ) -> Option<Retained<Self>>

Source

pub fn initWithContentsOfFile( this: Allocated<Self>, file_name: &NSString, ) -> Option<Retained<Self>>

Source

pub fn initWithContentsOfURL( this: Allocated<Self>, url: &NSURL, ) -> Option<Retained<Self>>

Source

pub fn initByReferencingFile( this: Allocated<Self>, file_name: &NSString, ) -> Option<Retained<Self>>

Source

pub fn initByReferencingURL( this: Allocated<Self>, url: &NSURL, ) -> Retained<Self>

Source

pub fn initWithPasteboard( this: Allocated<Self>, pasteboard: &NSPasteboard, ) -> Option<Retained<Self>>

Available on crate feature NSPasteboard only.
Source

pub fn initWithDataIgnoringOrientation( this: Allocated<Self>, data: &NSData, ) -> Option<Retained<Self>>

Source

pub fn imageWithSize_flipped_drawingHandler( size: NSSize, drawing_handler_should_be_called_with_flipped_context: bool, drawing_handler: &DynBlock<dyn Fn(NSRect) -> Bool>, ) -> Retained<Self>

Available on crate feature block2 only.
Source

pub fn size(&self) -> NSSize

Source

pub fn setSize(&self, size: NSSize)

Setter for size.

Source

pub fn setName(&self, string: Option<&NSImageName>) -> bool

Source

pub fn name(&self) -> Option<Retained<NSImageName>>

Source

pub fn backgroundColor(&self) -> Retained<NSColor>

Available on crate feature NSColor only.
Source

pub fn setBackgroundColor(&self, background_color: &NSColor)

Available on crate feature NSColor only.

Setter for backgroundColor.

This is copied when set.

Source

pub fn usesEPSOnResolutionMismatch(&self) -> bool

Source

pub fn setUsesEPSOnResolutionMismatch( &self, uses_eps_on_resolution_mismatch: bool, )

Source

pub fn prefersColorMatch(&self) -> bool

Source

pub fn setPrefersColorMatch(&self, prefers_color_match: bool)

Setter for prefersColorMatch.

Source

pub fn matchesOnMultipleResolution(&self) -> bool

Source

pub fn setMatchesOnMultipleResolution( &self, matches_on_multiple_resolution: bool, )

Source

pub fn matchesOnlyOnBestFittingAxis(&self) -> bool

Source

pub fn setMatchesOnlyOnBestFittingAxis( &self, matches_only_on_best_fitting_axis: bool, )

Source

pub fn drawAtPoint_fromRect_operation_fraction( &self, point: NSPoint, from_rect: NSRect, op: NSCompositingOperation, delta: CGFloat, )

Available on crate features NSGraphics and objc2-core-foundation only.
Source

pub fn drawInRect_fromRect_operation_fraction( &self, rect: NSRect, from_rect: NSRect, op: NSCompositingOperation, delta: CGFloat, )

Available on crate features NSGraphics and objc2-core-foundation only.
Source

pub unsafe fn drawInRect_fromRect_operation_fraction_respectFlipped_hints( &self, dst_space_portion_rect: NSRect, src_space_portion_rect: NSRect, op: NSCompositingOperation, requested_alpha: CGFloat, respect_context_is_flipped: bool, hints: Option<&NSDictionary<NSImageHintKey, AnyObject>>, )

Available on crate features NSGraphics and NSImageRep and objc2-core-foundation only.
§Safety

hints generic should be of the correct type.

Source

pub fn drawRepresentation_inRect( &self, image_rep: &NSImageRep, rect: NSRect, ) -> bool

Available on crate feature NSImageRep only.
Source

pub fn drawInRect(&self, rect: NSRect)

Source

pub fn recache(&self)

Source

pub fn TIFFRepresentation(&self) -> Option<Retained<NSData>>

Source

pub fn TIFFRepresentationUsingCompression_factor( &self, comp: NSTIFFCompression, factor: c_float, ) -> Option<Retained<NSData>>

Available on crate feature NSBitmapImageRep only.
Source

pub fn representations(&self) -> Retained<NSArray<NSImageRep>>

Available on crate feature NSImageRep only.
Source

pub fn addRepresentations(&self, image_reps: &NSArray<NSImageRep>)

Available on crate feature NSImageRep only.
Source

pub fn addRepresentation(&self, image_rep: &NSImageRep)

Available on crate feature NSImageRep only.
Source

pub fn removeRepresentation(&self, image_rep: &NSImageRep)

Available on crate feature NSImageRep only.
Source

pub fn isValid(&self) -> bool

Source

pub fn delegate(&self) -> Option<Retained<ProtocolObject<dyn NSImageDelegate>>>

Source

pub fn setDelegate( &self, delegate: Option<&ProtocolObject<dyn NSImageDelegate>>, )

Setter for delegate.

This is a weak property.

Source

pub fn imageTypes() -> Retained<NSArray<NSString>>

Source

pub fn imageUnfilteredTypes() -> Retained<NSArray<NSString>>

Source

pub fn canInitWithPasteboard(pasteboard: &NSPasteboard) -> bool

Available on crate feature NSPasteboard only.
Source

pub fn cacheMode(&self) -> NSImageCacheMode

Source

pub fn setCacheMode(&self, cache_mode: NSImageCacheMode)

Setter for cacheMode.

Source

pub fn alignmentRect(&self) -> NSRect

Source

pub fn setAlignmentRect(&self, alignment_rect: NSRect)

Setter for alignmentRect.

Source

pub fn isTemplate(&self) -> bool

Source

pub fn setTemplate(&self, template: bool)

Setter for isTemplate.

Source

pub fn accessibilityDescription(&self) -> Option<Retained<NSString>>

Source

pub fn setAccessibilityDescription( &self, accessibility_description: Option<&NSString>, )

Setter for accessibilityDescription.

This is copied when set.

Source

pub fn initWithCGImage_size( this: Allocated<Self>, cg_image: &CGImage, size: NSSize, ) -> Retained<Self>

Available on crate feature objc2-core-graphics and Apple only.
Source

pub unsafe fn CGImageForProposedRect_context_hints( &self, proposed_dest_rect: *mut NSRect, reference_context: Option<&NSGraphicsContext>, hints: Option<&NSDictionary<NSImageHintKey, AnyObject>>, ) -> Option<Retained<CGImage>>

Available on crate feature NSGraphicsContext and crate feature NSImageRep and crate feature objc2-core-graphics and Apple only.
§Safety
  • proposed_dest_rect must be a valid pointer or null.
  • hints generic should be of the correct type.
Source

pub unsafe fn bestRepresentationForRect_context_hints( &self, rect: NSRect, reference_context: Option<&NSGraphicsContext>, hints: Option<&NSDictionary<NSImageHintKey, AnyObject>>, ) -> Option<Retained<NSImageRep>>

Available on crate features NSGraphicsContext and NSImageRep only.
§Safety

hints generic should be of the correct type.

Source

pub unsafe fn hitTestRect_withImageDestinationRect_context_hints_flipped( &self, test_rect_dest_space: NSRect, image_rect_dest_space: NSRect, context: Option<&NSGraphicsContext>, hints: Option<&NSDictionary<NSImageHintKey, AnyObject>>, flipped: bool, ) -> bool

Available on crate features NSGraphicsContext and NSImageRep only.
§Safety

hints generic should be of the correct type.

Source

pub fn recommendedLayerContentsScale( &self, preferred_contents_scale: CGFloat, ) -> CGFloat

Available on crate feature objc2-core-foundation only.
Source

pub fn layerContentsForContentsScale( &self, layer_contents_scale: CGFloat, ) -> Retained<AnyObject>

Available on crate feature objc2-core-foundation only.
Source

pub fn capInsets(&self) -> NSEdgeInsets

Source

pub fn setCapInsets(&self, cap_insets: NSEdgeInsets)

Setter for capInsets.

Source

pub fn resizingMode(&self) -> NSImageResizingMode

Source

pub fn setResizingMode(&self, resizing_mode: NSImageResizingMode)

Setter for resizingMode.

Source

pub fn imageWithSymbolConfiguration( &self, configuration: &NSImageSymbolConfiguration, ) -> Option<Retained<NSImage>>

Source

pub fn symbolConfiguration(&self) -> Retained<NSImageSymbolConfiguration>

Source

pub fn imageWithLocale(&self, locale: Option<&NSLocale>) -> Retained<NSImage>

Creates and returns a new image with the specified locale. If the receiver contains locale-sensitive representations, the returned image will prefer to draw using representations appropriate for the specified locale. If locale is nil, the returned image uses the default behavior of choosing representations appropriate for the system’s currently-configured locale.

Source

pub fn locale(&self) -> Option<Retained<NSLocale>>

The image’s preferred locale for resolving representations, if one has been specified using -imageWithLocale:. Otherwise, nil.

Source§

impl NSImage

Methods declared on superclass NSObject.

Source

pub fn init(this: Allocated<Self>) -> Retained<Self>

Source

pub fn new() -> Retained<Self>

Source§

impl NSImage

Deprecated.

Source

pub fn imageUnfilteredFileTypes() -> Retained<NSArray<NSString>>

👎Deprecated: Use +imageUnfilteredTypes instead
Source

pub fn imageUnfilteredPasteboardTypes() -> Retained<NSArray<NSPasteboardType>>

👎Deprecated: Use +imageUnfilteredTypes instead
Available on crate feature NSPasteboard only.
Source

pub fn imageFileTypes() -> Retained<NSArray<NSString>>

👎Deprecated: Use +imageTypes instead
Source

pub fn imagePasteboardTypes() -> Retained<NSArray<NSPasteboardType>>

👎Deprecated: Use +imageTypes instead
Available on crate feature NSPasteboard only.
Source

pub unsafe fn bestRepresentationForDevice( &self, device_description: Option<&NSDictionary>, ) -> Option<Retained<NSImageRep>>

👎Deprecated: Use -[NSImage bestRepresentationForRect:context:hints:] instead. Any deviceDescription dictionary is also a valid hints dictionary.
Available on crate feature NSImageRep only.
§Safety
  • device_description generic should be of the correct type.
  • device_description might not allow None.
Source

pub fn lockFocus(&self)

👎Deprecated: This method is incompatible with resolution-independent drawing and should not be used. Instead, use +[NSImage imageWithSize:flipped:drawingHandler:] to create a block-based image describing the desired image drawing, or use +[NSGraphicsContext graphicsContextWithBitmapImageRep:] to manipulate specific bitmap image representations.
Source

pub fn lockFocusFlipped(&self, flipped: bool)

👎Deprecated: This method is incompatible with resolution-independent drawing and should not be used. Instead, use +[NSImage imageWithSize:flipped:drawingHandler:] to create a block-based image describing the desired image drawing, or use +[NSGraphicsContext graphicsContextWithBitmapImageRep:] to manipulate specific bitmap image representations.
Source

pub fn unlockFocus(&self)

👎Deprecated: This method is incompatible with resolution-independent drawing and should not be used. Instead, use +[NSImage imageWithSize:flipped:drawingHandler:] to create a block-based image describing the desired image drawing, or use +[NSGraphicsContext graphicsContextWithBitmapImageRep:] to manipulate specific bitmap image representations.
Source

pub fn setFlipped(&self, flag: bool)

👎Deprecated: The concept of flippedness for NSImage is deprecated. Please see the AppKit 10.6 release notes for a discussion of why and for how to replace existing usage.
Source

pub fn isFlipped(&self) -> bool

👎Deprecated: The concept of flippedness for NSImage is deprecated. Please see the AppKit 10.6 release notes for a discussion of why and for how to replace existing usage.
Source

pub fn setScalesWhenResized(&self, flag: bool)

👎Deprecated: You should be able to remove use of this method without any replacement. See 10.6 AppKit release notes for details.
Source

pub fn scalesWhenResized(&self) -> bool

👎Deprecated: You should be able to remove use of this method without any replacement. See 10.6 AppKit release notes for details.
Source

pub fn setDataRetained(&self, flag: bool)

👎Deprecated: You should be able to remove use of this method without any replacement. See 10.6 AppKit release notes for details.
Source

pub fn isDataRetained(&self) -> bool

👎Deprecated: You should be able to remove use of this method without any replacement. See 10.6 AppKit release notes for details.
Source

pub fn setCachedSeparately(&self, flag: bool)

👎Deprecated: You should be able to remove use of this method without any replacement. See 10.6 AppKit release notes for details.
Source

pub fn isCachedSeparately(&self) -> bool

👎Deprecated: You should be able to remove use of this method without any replacement. See 10.6 AppKit release notes for details.
Source

pub fn setCacheDepthMatchesImageDepth(&self, flag: bool)

👎Deprecated: You should be able to remove use of this method without any replacement. See 10.6 AppKit release notes for details.
Source

pub fn cacheDepthMatchesImageDepth(&self) -> bool

👎Deprecated: You should be able to remove use of this method without any replacement. See 10.6 AppKit release notes for details.
Source

pub fn dissolveToPoint_fraction(&self, point: NSPoint, fraction: CGFloat)

👎Deprecated: Use -drawAtPoint:… or -drawInRect:… methods instead
Available on crate feature objc2-core-foundation only.
Source

pub fn dissolveToPoint_fromRect_fraction( &self, point: NSPoint, rect: NSRect, fraction: CGFloat, )

👎Deprecated: Use -drawAtPoint:… or -drawInRect:… methods instead
Available on crate feature objc2-core-foundation only.
Source

pub fn compositeToPoint_operation( &self, point: NSPoint, operation: NSCompositingOperation, )

👎Deprecated: Use -drawAtPoint:… or -drawInRect:… methods instead
Available on crate feature NSGraphics only.
Source

pub fn compositeToPoint_fromRect_operation( &self, point: NSPoint, rect: NSRect, operation: NSCompositingOperation, )

👎Deprecated: Use -drawAtPoint:… or -drawInRect:… methods instead
Available on crate feature NSGraphics only.
Source

pub fn compositeToPoint_operation_fraction( &self, point: NSPoint, operation: NSCompositingOperation, fraction: CGFloat, )

👎Deprecated: Use -drawAtPoint:… or -drawInRect:… methods instead
Available on crate features NSGraphics and objc2-core-foundation only.
Source

pub fn compositeToPoint_fromRect_operation_fraction( &self, point: NSPoint, rect: NSRect, operation: NSCompositingOperation, fraction: CGFloat, )

👎Deprecated: Use -drawAtPoint:… or -drawInRect:… methods instead
Available on crate features NSGraphics and objc2-core-foundation only.
Source

pub unsafe fn lockFocusOnRepresentation( &self, image_representation: Option<&NSImageRep>, )

👎Deprecated: Create an image using +[NSImage imageWithSize:flipped:drawingHandler:], and begin your custom drawing with -[NSImageRep drawInRect:] instead.
Available on crate feature NSImageRep only.
§Safety

image_representation might not allow None.

Source

pub fn cancelIncrementalLoad(&self)

👎Deprecated: This method does not perform any operation on 10.4 or later.

Methods from Deref<Target = NSObject>§

Source

pub fn doesNotRecognizeSelector(&self, sel: Sel) -> !

Handle messages the object doesn’t recognize.

See Apple’s documentation for details.

Methods from Deref<Target = AnyObject>§

Source

pub fn class(&self) -> &'static AnyClass

Available on crate feature NSAccessibilityConstants only.

Dynamically find the class of this object.

§Panics

May panic if the object is invalid (which may be the case for objects returned from unavailable init/new methods).

§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());
Source

pub unsafe fn get_ivar<T>(&self, name: &str) -> &T
where T: Encode,

👎Deprecated: this is difficult to use correctly, use Ivar::load instead.
Available on crate feature NSAccessibilityConstants only.

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.

Source

pub fn downcast_ref<T>(&self) -> Option<&T>
where T: DowncastTarget,

Available on crate feature NSAccessibilityConstants only.

Attempt to downcast the object to a class of type T.

This is the reference-variant. Use Retained::downcast if you want to convert a retained object to another type.

§Mutable classes

Some classes have immutable and mutable variants, such as NSString and NSMutableString.

When some Objective-C API signature says it gives you an immutable class, it generally expects you to not mutate that, even though it may technically be mutable “under the hood”.

So using this method to convert a NSString to a NSMutableString, while not unsound, is generally frowned upon unless you created the string yourself, or the API explicitly documents the string to be mutable.

See Apple’s documentation on mutability and on isKindOfClass: for more details.

§Generic classes

Objective-C generics are called “lightweight generics”, and that’s because they aren’t exposed in the runtime. This makes it impossible to safely downcast to generic collections, so this is disallowed by this method.

You can, however, safely downcast to generic collections where all the type-parameters are AnyObject.

§Panics

This works internally by calling isKindOfClass:. That means that the object must have the instance method of that name, and an exception will be thrown (if CoreFoundation is linked) or the process will abort if that is not the case. In the vast majority of cases, you don’t need to worry about this, since both root objects NSObject and NSProxy implement this method.

§Examples

Cast an NSString back and forth from NSObject.

use objc2::rc::Retained;
use objc2_foundation::{NSObject, NSString};

let obj: Retained<NSObject> = NSString::new().into_super();
let string = obj.downcast_ref::<NSString>().unwrap();
// Or with `downcast`, if we do not need the object afterwards
let string = obj.downcast::<NSString>().unwrap();

Try (and fail) to cast an NSObject to an NSString.

use objc2_foundation::{NSObject, NSString};

let obj = NSObject::new();
assert!(obj.downcast_ref::<NSString>().is_none());

Try to cast to an array of strings.

use objc2_foundation::{NSArray, NSObject, NSString};

let arr = NSArray::from_retained_slice(&[NSObject::new()]);
// This is invalid and doesn't type check.
let arr = arr.downcast_ref::<NSArray<NSString>>();

This fails to compile, since it would require enumerating over the array to ensure that each element is of the desired type, which is a performance pitfall.

Downcast when processing each element instead.

use objc2_foundation::{NSArray, NSObject, NSString};

let arr = NSArray::from_retained_slice(&[NSObject::new()]);

for elem in arr {
    if let Some(data) = elem.downcast_ref::<NSString>() {
        // handle `data`
    }
}

Trait Implementations§

Source§

impl AsRef<AnyObject> for NSImage

Source§

fn as_ref(&self) -> &AnyObject

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<NSImage> for NSImage

Source§

fn as_ref(&self) -> &Self

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<NSObject> for NSImage

Source§

fn as_ref(&self) -> &NSObject

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Borrow<AnyObject> for NSImage

Source§

fn borrow(&self) -> &AnyObject

Immutably borrows from an owned value. Read more
Source§

impl Borrow<NSObject> for NSImage

Source§

fn borrow(&self) -> &NSObject

Immutably borrows from an owned value. Read more
Source§

impl ClassType for NSImage

Source§

const NAME: &'static str = "NSImage"

The name of the Objective-C class that this type represents. Read more
Source§

type Super = NSObject

The superclass of this class. Read more
Source§

type ThreadKind = <<NSImage as ClassType>::Super as ClassType>::ThreadKind

Whether the type can be used from any thread, or from only the main thread. Read more
Source§

fn class() -> &'static AnyClass

Get a reference to the Objective-C class that this type represents. Read more
Source§

fn as_super(&self) -> &Self::Super

Get an immutable reference to the superclass.
Source§

impl CopyingHelper for NSImage

Source§

type Result = NSImage

The immutable counterpart of the type, or Self if the type has no immutable counterpart. Read more
Source§

impl Debug for NSImage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl DefaultRetained for NSImage

Source§

fn default_retained() -> Retained<Self>

The default Retained for a type. Read more
Source§

impl Deref for NSImage

Source§

type Target = NSObject

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl Hash for NSImage

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Message for NSImage

Source§

fn retain(&self) -> Retained<Self>
where Self: Sized,

Increment the reference count of the receiver. Read more
Source§

impl NSCoding for NSImage

Source§

unsafe fn encodeWithCoder(&self, coder: &NSCoder)
where Self: Sized + Message,

Safety Read more
Source§

unsafe fn initWithCoder( this: Allocated<Self>, coder: &NSCoder, ) -> Option<Retained<Self>>
where Self: Sized + Message,

Safety Read more
Source§

impl NSCopying for NSImage

Source§

fn copy(&self) -> Retained<Self::Result>
where Self: Sized + Message + CopyingHelper,

Returns a new instance that’s a copy of the receiver. Read more
Source§

unsafe fn copyWithZone(&self, zone: *mut NSZone) -> Retained<Self::Result>
where Self: Sized + Message + CopyingHelper,

Returns a new instance that’s a copy of the receiver. Read more
Source§

impl NSItemProviderReading for NSImage

Source§

impl NSItemProviderWriting for NSImage

Source§

impl NSObjectProtocol for NSImage

Source§

fn isEqual(&self, other: Option<&AnyObject>) -> bool
where Self: Sized + Message,

Check whether the object is equal to an arbitrary other object. Read more
Source§

fn hash(&self) -> usize
where Self: Sized + Message,

An integer that can be used as a table address in a hash table structure. Read more
Source§

fn isKindOfClass(&self, cls: &AnyClass) -> bool
where Self: Sized + Message,

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
where T: ClassType, Self: Sized + Message,

👎Deprecated: use isKindOfClass directly, or cast your objects with AnyObject::downcast_ref
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
where Self: Sized + Message,

Check if the object is an instance of a specific class, without checking subclasses. Read more
Source§

fn respondsToSelector(&self, aSelector: Sel) -> bool
where Self: Sized + Message,

Check whether the object implements or inherits a method with the given selector. Read more
Source§

fn conformsToProtocol(&self, aProtocol: &AnyProtocol) -> bool
where Self: Sized + Message,

Check whether the object conforms to a given protocol. Read more
Source§

fn description(&self) -> Retained<NSObject>
where Self: Sized + Message,

A textual representation of the object. Read more
Source§

fn debugDescription(&self) -> Retained<NSObject>
where Self: Sized + Message,

A textual representation of the object to use when debugging. Read more
Source§

fn isProxy(&self) -> bool
where Self: Sized + Message,

Check whether the receiver is a subclass of the NSProxy root class instead of the usual NSObject. Read more
Source§

fn retainCount(&self) -> usize
where Self: Sized + Message,

The reference count of the object. Read more
Source§

impl NSPasteboardReading for NSImage

Source§

fn readableTypesForPasteboard( pasteboard: &NSPasteboard, ) -> Retained<NSArray<NSPasteboardType>>
where Self: Sized + ClassType,

Available on crate feature NSPasteboard only.
Source§

fn readingOptionsForType_pasteboard( type: &NSPasteboardType, pasteboard: &NSPasteboard, ) -> NSPasteboardReadingOptions
where Self: Sized + ClassType,

Available on crate feature NSPasteboard only.
Source§

unsafe fn initWithPasteboardPropertyList_ofType( this: Allocated<Self>, property_list: &AnyObject, type: &NSPasteboardType, ) -> Option<Retained<Self>>
where Self: Sized + Message,

Available on crate feature NSPasteboard only.
Safety Read more
Source§

impl NSPasteboardWriting for NSImage

Source§

fn writableTypesForPasteboard( &self, pasteboard: &NSPasteboard, ) -> Retained<NSArray<NSPasteboardType>>
where Self: Sized + Message,

Available on crate feature NSPasteboard only.
Source§

fn writingOptionsForType_pasteboard( &self, type: &NSPasteboardType, pasteboard: &NSPasteboard, ) -> NSPasteboardWritingOptions
where Self: Sized + Message,

Available on crate feature NSPasteboard only.
Source§

fn pasteboardPropertyListForType( &self, type: &NSPasteboardType, ) -> Option<Retained<AnyObject>>
where Self: Sized + Message,

Available on crate feature NSPasteboard only.
Source§

impl NSSecureCoding for NSImage

Source§

impl PartialEq for NSImage

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl RefEncode for NSImage

Source§

const ENCODING_REF: Encoding = <NSObject as ::objc2::RefEncode>::ENCODING_REF

The Objective-C type-encoding for a reference of this type. Read more
Source§

impl DowncastTarget for NSImage

Source§

impl Eq for NSImage

Auto Trait Implementations§

§

impl !Freeze for NSImage

§

impl !RefUnwindSafe for NSImage

§

impl !Send for NSImage

§

impl !Sync for NSImage

§

impl !Unpin for NSImage

§

impl !UnwindSafe for NSImage

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T> AnyThread for T
where T: ClassType<ThreadKind = dyn AnyThread + 'a> + ?Sized,

Source§

fn alloc() -> Allocated<Self>
where Self: Sized + ClassType,

Allocate a new instance of the class. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> AutoreleaseSafe for T
where T: ?Sized,