FSVolumeItemDeactivation

Trait FSVolumeItemDeactivation 

Source
pub unsafe trait FSVolumeItemDeactivation: NSObjectProtocol {
    // Provided methods
    unsafe fn itemDeactivationPolicy(&self) -> FSItemDeactivationOptions
       where Self: Sized + Message { ... }
    unsafe fn deactivateItem_replyHandler(
        &self,
        item: &FSItem,
        reply: &DynBlock<dyn Fn(*mut NSError)>,
    )
       where Self: Sized + Message { ... }
}
Available on crate feature FSVolume only.
Expand description

Methods and properties implemented by volumes that support deactivating items.

See also Apple’s documentation

Provided Methods§

Source

unsafe fn itemDeactivationPolicy(&self) -> FSItemDeactivationOptions
where Self: Sized + Message,

A property that tells FSKit to which types of items the deactivation applies, if any.

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.

Source

unsafe fn deactivateItem_replyHandler( &self, item: &FSItem, reply: &DynBlock<dyn Fn(*mut NSError)>, )
where Self: Sized + Message,

Available on crate features FSItem and block2 only.

Notifies the file system that the kernel is no longer making immediate use of the given item.

This method gives a file system a chance to release resources associated wtih an item. However, this method prescribes no specific action; it’s acceptable to defer all reclamation until FSVolume/Operations/reclaimItem(_:replyHandler:). This method is the equivalent of VFS’s VNOP_INACTIVE.

FSKit restricts calls to this method based on the current value of FSVolume/ItemDeactivation/itemDeactivationPolicy.

  • Parameters:
  • item: The item to deactivate.
  • reply: A block or closure to indicate success or failure. If deactivation fails, pass an error as the one parameter to the reply handler. If deactivation succeeds, pass nil. For an async Swift implementation, there’s no reply handler; simply throw an error or return normally.

Trait Implementations§

Source§

impl ProtocolType for dyn FSVolumeItemDeactivation

Source§

const NAME: &'static str = "FSVolumeItemDeactivation"

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 FSVolumeItemDeactivation

Implementations on Foreign Types§

Source§

impl<T> FSVolumeItemDeactivation for ProtocolObject<T>

Implementors§