FSUnaryFileSystemOperations

Trait FSUnaryFileSystemOperations 

Source
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 { ... }
}
Available on crate feature 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§

Source

unsafe fn probeResource_replyHandler( &self, resource: &FSResource, reply: &DynBlock<dyn Fn(*mut FSProbeResult, *mut NSError)>, )
where Self: Sized + Message,

Available on crate features 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 FSResource to probe.
  • reply: A block or closure that your implementation invokes when it finishes the probe or encounters an error. Pass an instance of FSProbeResult with probe results as the first parameter if your probe operation succeeds. If probing fails, pass an error as the second parameter.
Source

unsafe fn loadResource_options_replyHandler( &self, resource: &FSResource, options: &FSTaskOptions, reply: &DynBlock<dyn Fn(*mut FSVolume, *mut NSError)>, )
where Self: Sized + Message,

Available on crate features 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 FSResource to load.
  • options: An FSTaskOptions object specifying options to apply when loading the resource. An FSUnaryFileSystem supports two options: -f for “force” and --rdonly for 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 FSVolume as the first parameter if loading succeeds. If loading fails, pass an error as the second parameter.
Source

unsafe fn unloadResource_options_replyHandler( &self, resource: &FSResource, options: &FSTaskOptions, reply: &DynBlock<dyn Fn(*mut NSError)>, )
where Self: Sized + Message,

Available on crate features FSResource and FSTaskOptions and block2 only.

Requests that the file system unload the specified resource.

  • Parameters:
  • resource: An FSResource to unload.
  • options: An FSTaskOptions object 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.
Source

unsafe fn didFinishLoading(&self)
where Self: Sized + Message,

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.

Trait Implementations§

Source§

impl ProtocolType for dyn FSUnaryFileSystemOperations

Source§

const NAME: &'static str = "FSUnaryFileSystemOperations"

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

fn protocol() -> Option<&'static AnyProtocol>

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

impl<T> ImplementedBy<T> for dyn FSUnaryFileSystemOperations

Implementations on Foreign Types§

Source§

impl<T> FSUnaryFileSystemOperations for ProtocolObject<T>

Implementors§