Struct icrate::Foundation::NSURL
source · #[repr(C)]pub struct NSURL { /* private fields */ }Foundation and Foundation_NSURL only.Implementations§
source§impl NSURL
impl NSURL
NSPasteboardSupport
pub unsafe fn URLFromPasteboard(paste_board: &NSPasteboard) -> Option<Id<NSURL>>
AppKit and AppKit_NSPasteboard only.pub unsafe fn writeToPasteboard(&self, paste_board: &NSPasteboard)
AppKit and AppKit_NSPasteboard only.source§impl NSURL
impl NSURL
pub unsafe fn initWithScheme_host_path( this: Option<Allocated<Self>>, scheme: &NSString, host: Option<&NSString>, path: &NSString ) -> Option<Id<Self>>
Foundation_NSString only.pub unsafe fn initFileURLWithPath_isDirectory_relativeToURL( this: Option<Allocated<Self>>, path: &NSString, is_dir: bool, base_url: Option<&NSURL> ) -> Id<Self>
Foundation_NSString only.pub unsafe fn initFileURLWithPath_relativeToURL( this: Option<Allocated<Self>>, path: &NSString, base_url: Option<&NSURL> ) -> Id<Self>
Foundation_NSString only.pub unsafe fn initFileURLWithPath_isDirectory( this: Option<Allocated<Self>>, path: &NSString, is_dir: bool ) -> Id<Self>
Foundation_NSString only.pub unsafe fn initFileURLWithPath( this: Option<Allocated<Self>>, path: &NSString ) -> Id<Self>
Foundation_NSString only.pub unsafe fn fileURLWithPath_isDirectory_relativeToURL( path: &NSString, is_dir: bool, base_url: Option<&NSURL> ) -> Id<NSURL>
Foundation_NSString only.pub unsafe fn fileURLWithPath_relativeToURL( path: &NSString, base_url: Option<&NSURL> ) -> Id<NSURL>
Foundation_NSString only.pub unsafe fn fileURLWithPath_isDirectory( path: &NSString, is_dir: bool ) -> Id<NSURL>
Foundation_NSString only.pub unsafe fn fileURLWithPath(path: &NSString) -> Id<NSURL>
Foundation_NSString only.pub unsafe fn initFileURLWithFileSystemRepresentation_isDirectory_relativeToURL( this: Option<Allocated<Self>>, path: NonNull<c_char>, is_dir: bool, base_url: Option<&NSURL> ) -> Id<Self>
pub unsafe fn fileURLWithFileSystemRepresentation_isDirectory_relativeToURL( path: NonNull<c_char>, is_dir: bool, base_url: Option<&NSURL> ) -> Id<NSURL>
pub unsafe fn initWithString( this: Option<Allocated<Self>>, url_string: &NSString ) -> Option<Id<Self>>
Foundation_NSString only.pub unsafe fn initWithString_relativeToURL( this: Option<Allocated<Self>>, url_string: &NSString, base_url: Option<&NSURL> ) -> Option<Id<Self>>
Foundation_NSString only.pub unsafe fn URLWithString(url_string: &NSString) -> Option<Id<Self>>
Foundation_NSString only.pub unsafe fn URLWithString_relativeToURL( url_string: &NSString, base_url: Option<&NSURL> ) -> Option<Id<Self>>
Foundation_NSString only.pub unsafe fn initWithDataRepresentation_relativeToURL( this: Option<Allocated<Self>>, data: &NSData, base_url: Option<&NSURL> ) -> Id<Self>
Foundation_NSData only.pub unsafe fn URLWithDataRepresentation_relativeToURL( data: &NSData, base_url: Option<&NSURL> ) -> Id<NSURL>
Foundation_NSData only.pub unsafe fn initAbsoluteURLWithDataRepresentation_relativeToURL( this: Option<Allocated<Self>>, data: &NSData, base_url: Option<&NSURL> ) -> Id<Self>
Foundation_NSData only.pub unsafe fn absoluteURLWithDataRepresentation_relativeToURL( data: &NSData, base_url: Option<&NSURL> ) -> Id<NSURL>
Foundation_NSData only.pub unsafe fn dataRepresentation(&self) -> Id<NSData>
Foundation_NSData only.pub unsafe fn absoluteString(&self) -> Option<Id<NSString>>
Foundation_NSString only.pub unsafe fn relativeString(&self) -> Id<NSString>
Foundation_NSString only.pub unsafe fn baseURL(&self) -> Option<Id<NSURL>>
pub unsafe fn absoluteURL(&self) -> Option<Id<NSURL>>
pub unsafe fn scheme(&self) -> Option<Id<NSString>>
Foundation_NSString only.pub unsafe fn resourceSpecifier(&self) -> Option<Id<NSString>>
Foundation_NSString only.pub unsafe fn host(&self) -> Option<Id<NSString>>
Foundation_NSString only.pub unsafe fn port(&self) -> Option<Id<NSNumber>>
Foundation_NSNumber only.pub unsafe fn user(&self) -> Option<Id<NSString>>
Foundation_NSString only.pub unsafe fn password(&self) -> Option<Id<NSString>>
Foundation_NSString only.pub unsafe fn path(&self) -> Option<Id<NSString>>
Foundation_NSString only.pub unsafe fn fragment(&self) -> Option<Id<NSString>>
Foundation_NSString only.pub unsafe fn parameterString(&self) -> Option<Id<NSString>>
Foundation_NSString only.pub unsafe fn query(&self) -> Option<Id<NSString>>
Foundation_NSString only.pub unsafe fn relativePath(&self) -> Option<Id<NSString>>
Foundation_NSString only.pub unsafe fn hasDirectoryPath(&self) -> bool
pub unsafe fn getFileSystemRepresentation_maxLength( &self, buffer: NonNull<c_char>, max_buffer_length: NSUInteger ) -> bool
pub unsafe fn fileSystemRepresentation(&self) -> NonNull<c_char>
pub unsafe fn isFileURL(&self) -> bool
pub unsafe fn standardizedURL(&self) -> Option<Id<NSURL>>
pub unsafe fn checkResourceIsReachableAndReturnError( &self ) -> Result<(), Id<NSError>>
Foundation_NSError only.pub unsafe fn isFileReferenceURL(&self) -> bool
pub unsafe fn fileReferenceURL(&self) -> Option<Id<NSURL>>
pub unsafe fn filePathURL(&self) -> Option<Id<NSURL>>
pub unsafe fn getResourceValue_forKey_error( &self, value: &mut Option<Id<AnyObject>>, key: &NSURLResourceKey ) -> Result<(), Id<NSError>>
Foundation_NSError only.pub unsafe fn resourceValuesForKeys_error( &self, keys: &NSArray<NSURLResourceKey> ) -> Result<Id<NSDictionary<NSURLResourceKey, AnyObject>>, Id<NSError>>
Foundation_NSArray and Foundation_NSDictionary and Foundation_NSError only.pub unsafe fn setResourceValue_forKey_error( &self, value: Option<&AnyObject>, key: &NSURLResourceKey ) -> Result<(), Id<NSError>>
Foundation_NSError only.pub unsafe fn setResourceValues_error( &self, keyed_values: &NSDictionary<NSURLResourceKey, AnyObject> ) -> Result<(), Id<NSError>>
Foundation_NSDictionary and Foundation_NSError only.pub unsafe fn removeCachedResourceValueForKey(&self, key: &NSURLResourceKey)
pub unsafe fn removeAllCachedResourceValues(&self)
pub unsafe fn setTemporaryResourceValue_forKey( &self, value: Option<&AnyObject>, key: &NSURLResourceKey )
pub unsafe fn bookmarkDataWithOptions_includingResourceValuesForKeys_relativeToURL_error( &self, options: NSURLBookmarkCreationOptions, keys: Option<&NSArray<NSURLResourceKey>>, relative_url: Option<&NSURL> ) -> Result<Id<NSData>, Id<NSError>>
Foundation_NSArray and Foundation_NSData and Foundation_NSError only.pub unsafe fn initByResolvingBookmarkData_options_relativeToURL_bookmarkDataIsStale_error( this: Option<Allocated<Self>>, bookmark_data: &NSData, options: NSURLBookmarkResolutionOptions, relative_url: Option<&NSURL>, is_stale: *mut Bool ) -> Result<Id<Self>, Id<NSError>>
Foundation_NSData and Foundation_NSError only.pub unsafe fn URLByResolvingBookmarkData_options_relativeToURL_bookmarkDataIsStale_error( bookmark_data: &NSData, options: NSURLBookmarkResolutionOptions, relative_url: Option<&NSURL>, is_stale: *mut Bool ) -> Result<Id<Self>, Id<NSError>>
Foundation_NSData and Foundation_NSError only.pub unsafe fn resourceValuesForKeys_fromBookmarkData( keys: &NSArray<NSURLResourceKey>, bookmark_data: &NSData ) -> Option<Id<NSDictionary<NSURLResourceKey, AnyObject>>>
Foundation_NSArray and Foundation_NSData and Foundation_NSDictionary only.pub unsafe fn writeBookmarkData_toURL_options_error( bookmark_data: &NSData, bookmark_file_url: &NSURL, options: NSURLBookmarkFileCreationOptions ) -> Result<(), Id<NSError>>
Foundation_NSData and Foundation_NSError only.pub unsafe fn bookmarkDataWithContentsOfURL_error( bookmark_file_url: &NSURL ) -> Result<Id<NSData>, Id<NSError>>
Foundation_NSData and Foundation_NSError only.pub unsafe fn URLByResolvingAliasFileAtURL_options_error( url: &NSURL, options: NSURLBookmarkResolutionOptions ) -> Result<Id<Self>, Id<NSError>>
Foundation_NSError only.pub unsafe fn startAccessingSecurityScopedResource(&self) -> bool
pub unsafe fn stopAccessingSecurityScopedResource(&self)
source§impl NSURL
impl NSURL
NSPromisedItems
pub unsafe fn getPromisedItemResourceValue_forKey_error( &self, value: &mut Option<Id<AnyObject>>, key: &NSURLResourceKey ) -> Result<(), Id<NSError>>
Foundation_NSError only.pub unsafe fn promisedItemResourceValuesForKeys_error( &self, keys: &NSArray<NSURLResourceKey> ) -> Result<Id<NSDictionary<NSURLResourceKey, AnyObject>>, Id<NSError>>
Foundation_NSArray and Foundation_NSDictionary and Foundation_NSError only.pub unsafe fn checkPromisedItemIsReachableAndReturnError( &self ) -> Result<(), Id<NSError>>
Foundation_NSError only.impl NSURL
NSItemProvider
source§impl NSURL
impl NSURL
NSURLPathUtilities
pub unsafe fn fileURLWithPathComponents( components: &NSArray<NSString> ) -> Option<Id<NSURL>>
Foundation_NSArray and Foundation_NSString only.pub unsafe fn pathComponents(&self) -> Option<Id<NSArray<NSString>>>
Foundation_NSArray and Foundation_NSString only.pub unsafe fn lastPathComponent(&self) -> Option<Id<NSString>>
Foundation_NSString only.pub unsafe fn pathExtension(&self) -> Option<Id<NSString>>
Foundation_NSString only.pub unsafe fn URLByAppendingPathComponent( &self, path_component: &NSString ) -> Option<Id<NSURL>>
Foundation_NSString only.pub unsafe fn URLByAppendingPathComponent_isDirectory( &self, path_component: &NSString, is_directory: bool ) -> Option<Id<NSURL>>
Foundation_NSString only.pub unsafe fn URLByDeletingLastPathComponent(&self) -> Option<Id<NSURL>>
pub unsafe fn URLByAppendingPathExtension( &self, path_extension: &NSString ) -> Option<Id<NSURL>>
Foundation_NSString only.pub unsafe fn URLByDeletingPathExtension(&self) -> Option<Id<NSURL>>
pub unsafe fn URLByStandardizingPath(&self) -> Option<Id<NSURL>>
pub unsafe fn URLByResolvingSymlinksInPath(&self) -> Option<Id<NSURL>>
source§impl NSURL
impl NSURL
NSURLLoading
pub unsafe fn resourceDataUsingCache( &self, should_use_cache: bool ) -> Option<Id<NSData>>
Foundation_NSData only.pub unsafe fn loadResourceDataNotifyingClient_usingCache( &self, client: &AnyObject, should_use_cache: bool )
pub unsafe fn propertyForKey( &self, property_key: &NSString ) -> Option<Id<AnyObject>>
Foundation_NSString only.pub unsafe fn setResourceData(&self, data: &NSData) -> bool
Foundation_NSData only.pub unsafe fn setProperty_forKey( &self, property: &AnyObject, property_key: &NSString ) -> bool
Foundation_NSString only.pub unsafe fn URLHandleUsingCache( &self, should_use_cache: bool ) -> Option<Id<NSURLHandle>>
Foundation_NSURLHandle only.source§impl NSURL
impl NSURL
UTAdditions
pub unsafe fn URLByAppendingPathComponent_conformingToType( &self, partial_name: &NSString, content_type: &UTType ) -> Id<NSURL>
UniformTypeIdentifiers and Foundation_NSString and UniformTypeIdentifiers_UTType only.pub unsafe fn URLByAppendingPathExtensionForType( &self, content_type: &UTType ) -> Id<NSURL>
UniformTypeIdentifiers and UniformTypeIdentifiers_UTType only.Methods from Deref<Target = AnyObject>§
sourcepub unsafe fn ivar_ptr<T>(&self, name: &str) -> *mut Twhere
T: Encode,
pub unsafe fn ivar_ptr<T>(&self, name: &str) -> *mut Twhere T: Encode,
Returns a pointer to the instance variable / ivar with the given name.
This is similar to UnsafeCell::get, see that for more information
on what is and isn’t safe to do.
Usually you will have defined the instance variable yourself with
ClassBuilder::add_ivar, the type of the ivar T must match the
type used in that.
Attempting to access or modify private implementation details of a class that you do no control using this is not supported, and may invoke undefined behaviour.
Library implementors are strongly encouraged to expose a safe interface to the ivar.
Panics
May panic if the object has no ivar with the given name. May also
panic if the type encoding of the ivar differs from the type encoding
of T.
This should purely seen as help while debugging and is not guaranteed
(e.g. it may be disabled when debug_assertions are off).
Safety
The object must have an instance variable with the given name, and it
must be of type T. Any invariants that the object have assumed about
the value of the instance variable must not be violated.
No thread syncronization is done on accesses to the variable, so you must ensure that any access to the returned pointer do not cause data races, and that Rust’s mutability rules are not otherwise violated.
sourcepub unsafe fn ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
pub unsafe fn ivar<T>(&self, name: &str) -> &Twhere T: Encode,
Returns a reference to the instance variable with the given name.
See AnyObject::ivar_ptr for more information, including on when
this panics.
Safety
The object must have an instance variable with the given name, and it
must be of type T.
No thread syncronization is done, so you must ensure that no other
thread is concurrently mutating the variable. This requirement can be
considered upheld if all mutation happens through
AnyObject::ivar_mut (since that takes &mut self).
sourcepub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
👎Deprecated: Use AnyObject::ivar instead.
pub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere T: Encode,
AnyObject::ivar instead.sourcepub unsafe fn ivar_mut<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
pub unsafe fn ivar_mut<T>(&mut self, name: &str) -> &mut Twhere T: Encode,
Returns a mutable reference to the ivar with the given name.
See AnyObject::ivar_ptr for more information, including on when
this panics.
Safety
The object must have an instance variable with the given name, and it
must be of type T.
This access happens through &mut self, which means we know it to be
the only reference, hence you do not need to do any work to ensure
that data races do not happen.
sourcepub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
👎Deprecated: Use AnyObject::ivar_mut instead.
pub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere T: Encode,
AnyObject::ivar_mut instead.sourcepub unsafe fn set_ivar<T>(&mut self, name: &str, value: T)where
T: Encode,
pub unsafe fn set_ivar<T>(&mut self, name: &str, value: T)where T: Encode,
Sets the value of the ivar with the given name.
This is a shorthand for AnyObject::ivar_mut, see that for more
information.
Safety
Same as AnyObject::ivar_mut.
Trait Implementations§
source§impl BorrowMut<AnyObject> for NSURL
impl BorrowMut<AnyObject> for NSURL
source§fn borrow_mut(&mut self) -> &mut AnyObject
fn borrow_mut(&mut self) -> &mut AnyObject
source§impl BorrowMut<NSObject> for NSURL
impl BorrowMut<NSObject> for NSURL
source§fn borrow_mut(&mut self) -> &mut NSObject
fn borrow_mut(&mut self) -> &mut NSObject
source§impl ClassType for NSURL
impl ClassType for NSURL
§type Mutability = InteriorMutable
type Mutability = InteriorMutable
source§const NAME: &'static str = _
const NAME: &'static str = _
source§fn class() -> &'static AnyClass
fn class() -> &'static AnyClass
source§fn as_super_mut(&mut self) -> &mut Self::Super
fn as_super_mut(&mut self) -> &mut Self::Super
source§impl NSCoding for NSURL
impl NSCoding for NSURL
source§impl NSCopying for NSURL
impl NSCopying for NSURL
source§fn copy(&self) -> Id<<Self::Mutability as Copyhelper<Self>>::CopyOutput>where
Self: Sized + ClassType,
Self::Mutability: Copyhelper<Self>,
fn copy(&self) -> Id<<Self::Mutability as Copyhelper<Self>>::CopyOutput>where Self: Sized + ClassType, Self::Mutability: Copyhelper<Self>,
source§impl NSItemProviderReading for NSURL
impl NSItemProviderReading for NSURL
source§impl NSItemProviderWriting for NSURL
impl NSItemProviderWriting for NSURL
source§unsafe fn writableTypeIdentifiersForItemProvider_class(
) -> Id<NSArray<NSString>>where
Self: Sized + ClassType,
unsafe fn writableTypeIdentifiersForItemProvider_class( ) -> Id<NSArray<NSString>>where Self: Sized + ClassType,
Foundation_NSArray and Foundation_NSString only.source§unsafe fn writableTypeIdentifiersForItemProvider(&self) -> Id<NSArray<NSString>>where
Self: Sized + Message,
unsafe fn writableTypeIdentifiersForItemProvider(&self) -> Id<NSArray<NSString>>where Self: Sized + Message,
Foundation_NSArray and Foundation_NSString only.source§unsafe fn itemProviderVisibilityForRepresentationWithTypeIdentifier_class(
type_identifier: &NSString
) -> NSItemProviderRepresentationVisibilitywhere
Self: Sized + ClassType,
unsafe fn itemProviderVisibilityForRepresentationWithTypeIdentifier_class( type_identifier: &NSString ) -> NSItemProviderRepresentationVisibilitywhere Self: Sized + ClassType,
Foundation_NSString only.source§unsafe fn itemProviderVisibilityForRepresentationWithTypeIdentifier(
&self,
type_identifier: &NSString
) -> NSItemProviderRepresentationVisibilitywhere
Self: Sized + Message,
unsafe fn itemProviderVisibilityForRepresentationWithTypeIdentifier( &self, type_identifier: &NSString ) -> NSItemProviderRepresentationVisibilitywhere Self: Sized + Message,
Foundation_NSString only.source§unsafe fn loadDataWithTypeIdentifier_forItemProviderCompletionHandler(
&self,
type_identifier: &NSString,
completion_handler: &Block<(*mut NSData, *mut NSError), ()>
) -> Option<Id<NSProgress>>where
Self: Sized + Message,
unsafe fn loadDataWithTypeIdentifier_forItemProviderCompletionHandler( &self, type_identifier: &NSString, completion_handler: &Block<(*mut NSData, *mut NSError), ()> ) -> Option<Id<NSProgress>>where Self: Sized + Message,
Foundation_NSData and Foundation_NSError and Foundation_NSProgress and Foundation_NSString only.source§impl NSObjectProtocol for NSURL
impl NSObjectProtocol for NSURL
source§impl NSPasteboardReading for NSURL
Available on crate feature AppKit only.
impl NSPasteboardReading for NSURL
AppKit only.source§unsafe fn readableTypesForPasteboard(
pasteboard: &NSPasteboard
) -> Id<NSArray<NSPasteboardType>>where
Self: Sized + ClassType,
unsafe fn readableTypesForPasteboard( pasteboard: &NSPasteboard ) -> Id<NSArray<NSPasteboardType>>where Self: Sized + ClassType,
AppKit_NSPasteboard and Foundation_NSArray only.source§unsafe fn readingOptionsForType_pasteboard(
type: &NSPasteboardType,
pasteboard: &NSPasteboard
) -> NSPasteboardReadingOptionswhere
Self: Sized + ClassType,
unsafe fn readingOptionsForType_pasteboard( type: &NSPasteboardType, pasteboard: &NSPasteboard ) -> NSPasteboardReadingOptionswhere Self: Sized + ClassType,
AppKit_NSPasteboard only.unsafe fn initWithPasteboardPropertyList_ofType( this: Option<Allocated<Self>>, property_list: &AnyObject, type: &NSPasteboardType ) -> Option<Id<Self>>where Self: Sized + Message,
source§impl NSPasteboardWriting for NSURL
Available on crate feature AppKit only.
impl NSPasteboardWriting for NSURL
AppKit only.source§unsafe fn writableTypesForPasteboard(
&self,
pasteboard: &NSPasteboard
) -> Id<NSArray<NSPasteboardType>>where
Self: Sized + Message,
unsafe fn writableTypesForPasteboard( &self, pasteboard: &NSPasteboard ) -> Id<NSArray<NSPasteboardType>>where Self: Sized + Message,
AppKit_NSPasteboard and Foundation_NSArray only.source§unsafe fn writingOptionsForType_pasteboard(
&self,
type: &NSPasteboardType,
pasteboard: &NSPasteboard
) -> NSPasteboardWritingOptionswhere
Self: Sized + Message,
unsafe fn writingOptionsForType_pasteboard( &self, type: &NSPasteboardType, pasteboard: &NSPasteboard ) -> NSPasteboardWritingOptionswhere Self: Sized + Message,
AppKit_NSPasteboard only.