pub unsafe trait FSUnaryFileSystemOperations: NSObjectProtocol {
// Provided methods
unsafe fn probeResource_replyHandler(
&self,
resource: &FSResource,
reply: &DynBlock<dyn Fn(*mut FSProbeResult, *mut NSError)>,
)
where Self: Sized + Message { ... }
unsafe fn loadResource_options_replyHandler(
&self,
resource: &FSResource,
options: &FSTaskOptions,
reply: &DynBlock<dyn Fn(*mut FSVolume, *mut NSError)>,
)
where Self: Sized + Message { ... }
unsafe fn unloadResource_options_replyHandler(
&self,
resource: &FSResource,
options: &FSTaskOptions,
reply: &DynBlock<dyn Fn(*mut NSError)>,
)
where Self: Sized + Message { ... }
unsafe fn didFinishLoading(&self)
where Self: Sized + Message { ... }
}FSUnaryFileSystem only.Expand description
Operations performed by a unary file system.
Make sure your subclass of FSUnaryFileSystem conforms to this protocol.
See also Apple’s documentation
Provided Methods§
Sourceunsafe fn probeResource_replyHandler(
&self,
resource: &FSResource,
reply: &DynBlock<dyn Fn(*mut FSProbeResult, *mut NSError)>,
)
Available on crate features FSResource and block2 only.
unsafe fn probeResource_replyHandler( &self, resource: &FSResource, reply: &DynBlock<dyn Fn(*mut FSProbeResult, *mut NSError)>, )
FSResource and block2 only.Requests that the file system probe the specified resource.
Implement this method to indicate whether the resource is recognizable and usable.
- Parameters:
- resource: The
FSResourceto probe. - reply: A block or closure that your implementation invokes when it finishes the probe or encounters an error. Pass an instance of
FSProbeResultwith probe results as the first parameter if your probe operation succeeds. If probing fails, pass an error as the second parameter.
Sourceunsafe fn loadResource_options_replyHandler(
&self,
resource: &FSResource,
options: &FSTaskOptions,
reply: &DynBlock<dyn Fn(*mut FSVolume, *mut NSError)>,
)
Available on crate features FSResource and FSTaskOptions and FSVolume and block2 only.
unsafe fn loadResource_options_replyHandler( &self, resource: &FSResource, options: &FSTaskOptions, reply: &DynBlock<dyn Fn(*mut FSVolume, *mut NSError)>, )
FSResource and FSTaskOptions and FSVolume and block2 only.Requests that the file system load a resource and present it as a volume.
Implement this method by inspecting the provided resource and verifying it uses a supported format.
If the resource does use a supported format, create a subclass of FSVolume, clear the container error state, and invoke the reply callback, passing your volume as a parameter.
If loading can’t proceed, invoke reply and send an appropriate error as the second parameter.
- Parameters:
- resource: An
FSResourceto load. - options: An
FSTaskOptionsobject specifying options to apply when loading the resource. AnFSUnaryFileSystemsupports two options:-ffor “force” and--rdonlyfor read-only. The file system must remember if the read-only option is present. - reply: A block or closure that your implementation invokes when it finishes setting up or encounters an error. Pass a subclass of
FSVolumeas the first parameter if loading succeeds. If loading fails, pass an error as the second parameter.
Sourceunsafe fn unloadResource_options_replyHandler(
&self,
resource: &FSResource,
options: &FSTaskOptions,
reply: &DynBlock<dyn Fn(*mut NSError)>,
)
Available on crate features FSResource and FSTaskOptions and block2 only.
unsafe fn unloadResource_options_replyHandler( &self, resource: &FSResource, options: &FSTaskOptions, reply: &DynBlock<dyn Fn(*mut NSError)>, )
FSResource and FSTaskOptions and block2 only.Requests that the file system unload the specified resource.
- Parameters:
- resource: An
FSResourceto unload. - options: An
FSTaskOptionsobject specifying options to apply when unloading the resource. - reply: A block or closure that your implementation invokes when it finishes unloading or encounters an error. If unloading fails, pass an error as the parameter to describe the problem. Otherwise, pass
nil.
Sourceunsafe fn didFinishLoading(&self)
unsafe fn didFinishLoading(&self)
Notifies you that the system finished loading your file system extension.
The system performs this callback after the main run loop starts and before receiving the first message from the FSKit daemon.
Implement this method if you want to perform any setup prior to receiving FSKit callbacks.