FSVolumeXattrOperations

Trait FSVolumeXattrOperations 

Source
pub unsafe trait FSVolumeXattrOperations: NSObjectProtocol {
    // Provided methods
    unsafe fn xattrOperationsInhibited(&self) -> bool
       where Self: Sized + Message { ... }
    unsafe fn setXattrOperationsInhibited(
        &self,
        xattr_operations_inhibited: bool,
    )
       where Self: Sized + Message { ... }
    unsafe fn supportedXattrNamesForItem(
        &self,
        item: &FSItem,
    ) -> Retained<NSArray<FSFileName>>
       where Self: Sized + Message { ... }
    unsafe fn getXattrNamed_ofItem_replyHandler(
        &self,
        name: &FSFileName,
        item: &FSItem,
        reply: &DynBlock<dyn Fn(*mut NSData, *mut NSError)>,
    )
       where Self: Sized + Message { ... }
    unsafe fn setXattrNamed_toData_onItem_policy_replyHandler(
        &self,
        name: &FSFileName,
        value: Option<&NSData>,
        item: &FSItem,
        policy: FSSetXattrPolicy,
        reply: &DynBlock<dyn Fn(*mut NSError)>,
    )
       where Self: Sized + Message { ... }
    unsafe fn listXattrsOfItem_replyHandler(
        &self,
        item: &FSItem,
        reply: &DynBlock<dyn Fn(*mut NSArray<FSFileName>, *mut NSError)>,
    )
       where Self: Sized + Message { ... }
}
Available on crate feature FSVolume only.
Expand description

Methods and properties implemented by volumes that natively or partially support extended attributes.

See also Apple’s documentation

Provided Methods§

Source

unsafe fn xattrOperationsInhibited(&self) -> bool
where Self: Sized + Message,

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.

Source

unsafe fn setXattrOperationsInhibited(&self, xattr_operations_inhibited: bool)
where Self: Sized + Message,

Source

unsafe fn supportedXattrNamesForItem( &self, item: &FSItem, ) -> Retained<NSArray<FSFileName>>
where Self: Sized + Message,

Available on crate features FSFileName and FSItem only.

Returns an array that specifies the extended attribute names the given item supports.

If item supports no extended attributes, this method returns nil.

Only implement this method if your volume works with “limited” extended attributes. For purposes of this protocol, “limited” support means the volume doesn’t support extended attributes generally, but uses these APIs to expose specific file system data.

Note: If a file system implements this method, FSKit assumes limited support for extended attributes exists. In this mode, FSkit only calls this protocol’s methods for the extended attribute names this method returns.

  • Parameter item: The item for which to get information.
Source

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

Available on crate features FSFileName and FSItem and block2 only.

Gets the specified extended attribute of the given item.

  • Parameters:
  • name: The extended attribute name.
  • item: The item for which to get the extended attribute.
  • reply: A block or closure to indicate success or failure. If getting the attribute succeeds, pass an data instance containing the extended attribute data and a nil error. If getting the attribute fails, pass the relevant error as the second parameter; FSKit ignores any data in this case. For an async Swift implementation, there’s no reply handler; simply return the data or throw an error.
Source

unsafe fn setXattrNamed_toData_onItem_policy_replyHandler( &self, name: &FSFileName, value: Option<&NSData>, item: &FSItem, policy: FSSetXattrPolicy, reply: &DynBlock<dyn Fn(*mut NSError)>, )
where Self: Sized + Message,

Available on crate features FSFileName and FSItem and block2 only.

Sets the specified extended attribute data on the given item.

  • Parameters:
  • name: The extended attribute name.
  • value: The extended attribute value to set. This can’t be nil, unless the policy is FSVolume/SetXattrPolicy/delete.
  • item: The item on which to set the extended attribute.
  • policy: The policy to apply when setting the attribute. See FSSetXattrPolicy for possible values.
  • reply: A block or closure to indicate success or failure. If setting the attribute fails, pass an error as the one parameter to the reply handler. If setting the attribute succeeds, pass nil. For an async Swift implementation, there’s no reply handler; simply throw an error or return normally.
Source

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

Available on crate features FSFileName and FSItem and block2 only.

Gets the list of extended attributes currently set on the given item.

  • Parameters:
  • item: The item from which to get extended attributes.
  • reply: A block or closure to indicate success or failure. If getting the list of extended attributes succeeds, pass the xattrs as an array of FSFileName instances and a nil error. If getting the attriubtes fails, pass nil along with the relevant error. For an async Swift implementation, there’s no reply handler; simply return the byte count or throw an error.

Trait Implementations§

Source§

impl ProtocolType for dyn FSVolumeXattrOperations

Source§

const NAME: &'static str = "FSVolumeXattrOperations"

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 FSVolumeXattrOperations

Implementations on Foreign Types§

Source§

impl<T> FSVolumeXattrOperations for ProtocolObject<T>

Implementors§