pub unsafe trait FSVolumeOpenCloseOperations: NSObjectProtocol {
// Provided methods
unsafe fn isOpenCloseInhibited(&self) -> bool
where Self: Sized + Message { ... }
unsafe fn setOpenCloseInhibited(&self, open_close_inhibited: bool)
where Self: Sized + Message { ... }
unsafe fn openItem_withModes_replyHandler(
&self,
item: &FSItem,
modes: FSVolumeOpenModes,
reply: &DynBlock<dyn Fn(*mut NSError)>,
)
where Self: Sized + Message { ... }
unsafe fn closeItem_keepingModes_replyHandler(
&self,
item: &FSItem,
modes: FSVolumeOpenModes,
reply: &DynBlock<dyn Fn(*mut NSError)>,
)
where Self: Sized + Message { ... }
}
FSVolume
only.Expand description
Methods and properties implemented by volumes that want to receive open and close calls for each item.
When a file system volume conforms to this protocol, the kernel layer issues an open call to indicate desired access, and a close call to indicate what access to retain. A file is fully closed when the kernel layer issues a close call with no retained open nodes. When a file system receives the close call, it removes all access to the item. When all memory mappings to the item release, the kernel layer issues a final close.
If a file system volume doesn’t conform to this protocol, the kernel layer can skip making such calls to the volume.
See also Apple’s documentation
Provided Methods§
Sourceunsafe fn isOpenCloseInhibited(&self) -> bool
unsafe fn isOpenCloseInhibited(&self) -> bool
A Boolean value that instructs FSKit not to call this protocol’s methods, even if the volume conforms to it.
FSKit reads this value after the file system replies to the loadResource
message.
Changing the returned value during the runtime of the volume has no effect.
Sourceunsafe fn setOpenCloseInhibited(&self, open_close_inhibited: bool)
unsafe fn setOpenCloseInhibited(&self, open_close_inhibited: bool)
Setter for isOpenCloseInhibited
.
Sourceunsafe fn openItem_withModes_replyHandler(
&self,
item: &FSItem,
modes: FSVolumeOpenModes,
reply: &DynBlock<dyn Fn(*mut NSError)>,
)
Available on crate features FSItem
and block2
only.
unsafe fn openItem_withModes_replyHandler( &self, item: &FSItem, modes: FSVolumeOpenModes, reply: &DynBlock<dyn Fn(*mut NSError)>, )
FSItem
and block2
only.Opens a file for access.
- Parameters:
- item: The item to open.
- modes: The set of mode flags to open the item with.
- reply: A block or closure to indicate success or failure. If opening fails, pass an error as the one parameter to the reply handler. If opening succeeds, pass
nil
. For anasync
Swift implementation, there’s no reply handler; simply throw an error or return normally.
Sourceunsafe fn closeItem_keepingModes_replyHandler(
&self,
item: &FSItem,
modes: FSVolumeOpenModes,
reply: &DynBlock<dyn Fn(*mut NSError)>,
)
Available on crate features FSItem
and block2
only.
unsafe fn closeItem_keepingModes_replyHandler( &self, item: &FSItem, modes: FSVolumeOpenModes, reply: &DynBlock<dyn Fn(*mut NSError)>, )
FSItem
and block2
only.Closes a file from further access.
- Parameters:
- item: The item to close.
- modes: The set of mode flags to keep after this close.
- reply: A block or closure to indicate success or failure. If closing fails, pass an error as the one parameter to the reply handler. If closing succeeds, pass
nil
. For anasync
Swift implementation, there’s no reply handler; simply throw an error or return normally.