pub unsafe trait FSVolumeRenameOperations: NSObjectProtocol {
// Provided methods
unsafe fn isVolumeRenameInhibited(&self) -> bool
where Self: Sized + Message { ... }
unsafe fn setVolumeRenameInhibited(&self, volume_rename_inhibited: bool)
where Self: Sized + Message { ... }
unsafe fn setVolumeName_replyHandler(
&self,
name: &FSFileName,
reply: &DynBlock<dyn Fn(NonNull<FSFileName>, *mut NSError)>,
)
where Self: Sized + Message { ... }
}
Available on crate feature
FSVolume
only.Expand description
Methods and properties implemented by volumes that support renaming the volume.
See also Apple’s documentation
Provided Methods§
Sourceunsafe fn isVolumeRenameInhibited(&self) -> bool
unsafe fn isVolumeRenameInhibited(&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 setVolumeRenameInhibited(&self, volume_rename_inhibited: bool)
unsafe fn setVolumeRenameInhibited(&self, volume_rename_inhibited: bool)
Setter for isVolumeRenameInhibited
.
Sourceunsafe fn setVolumeName_replyHandler(
&self,
name: &FSFileName,
reply: &DynBlock<dyn Fn(NonNull<FSFileName>, *mut NSError)>,
)
Available on crate features FSFileName
and block2
only.
unsafe fn setVolumeName_replyHandler( &self, name: &FSFileName, reply: &DynBlock<dyn Fn(NonNull<FSFileName>, *mut NSError)>, )
FSFileName
and block2
only.Sets a new name for the volume.
- Parameters:
- name: The new volume name.
- reply: A block or closure to indicate success or failure. If renaming succeeds, pass an
FSFileName
of the new volume name and anil
error. If renaming fails, pass the relevant error as the second parameter; FSKit ignores anyFSFileName
in this case. For anasync
Swift implementation, there’s no reply handler; simply return theFSFileName
or throw an error.