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 { ... }
}FSVolume only.Expand description
Methods and properties implemented by volumes that natively or partially support extended attributes.
See also Apple’s documentation
Provided Methods§
Sourceunsafe fn xattrOperationsInhibited(&self) -> bool
unsafe fn xattrOperationsInhibited(&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 setXattrOperationsInhibited(&self, xattr_operations_inhibited: bool)
unsafe fn setXattrOperationsInhibited(&self, xattr_operations_inhibited: bool)
Setter for xattrOperationsInhibited.
Sourceunsafe fn supportedXattrNamesForItem(
&self,
item: &FSItem,
) -> Retained<NSArray<FSFileName>>
Available on crate features FSFileName and FSItem only.
unsafe fn supportedXattrNamesForItem( &self, item: &FSItem, ) -> Retained<NSArray<FSFileName>>
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.
Sourceunsafe fn getXattrNamed_ofItem_replyHandler(
&self,
name: &FSFileName,
item: &FSItem,
reply: &DynBlock<dyn Fn(*mut NSData, *mut NSError)>,
)
Available on crate features FSFileName and FSItem and block2 only.
unsafe fn getXattrNamed_ofItem_replyHandler( &self, name: &FSFileName, item: &FSItem, reply: &DynBlock<dyn Fn(*mut NSData, *mut NSError)>, )
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
nilerror. If getting the attribute fails, pass the relevant error as the second parameter; FSKit ignores any data in this case. For anasyncSwift implementation, there’s no reply handler; simply return the data or throw an error.
Sourceunsafe fn setXattrNamed_toData_onItem_policy_replyHandler(
&self,
name: &FSFileName,
value: Option<&NSData>,
item: &FSItem,
policy: FSSetXattrPolicy,
reply: &DynBlock<dyn Fn(*mut NSError)>,
)
Available on crate features FSFileName and FSItem and block2 only.
unsafe fn setXattrNamed_toData_onItem_policy_replyHandler( &self, name: &FSFileName, value: Option<&NSData>, item: &FSItem, policy: FSSetXattrPolicy, reply: &DynBlock<dyn Fn(*mut NSError)>, )
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 isFSVolume/SetXattrPolicy/delete. - item: The item on which to set the extended attribute.
- policy: The policy to apply when setting the attribute. See
FSSetXattrPolicyfor 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 anasyncSwift implementation, there’s no reply handler; simply throw an error or return normally.
Sourceunsafe fn listXattrsOfItem_replyHandler(
&self,
item: &FSItem,
reply: &DynBlock<dyn Fn(*mut NSArray<FSFileName>, *mut NSError)>,
)
Available on crate features FSFileName and FSItem and block2 only.
unsafe fn listXattrsOfItem_replyHandler( &self, item: &FSItem, reply: &DynBlock<dyn Fn(*mut NSArray<FSFileName>, *mut NSError)>, )
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
FSFileNameinstances and anilerror. If getting the attriubtes fails, passnilalong with the relevant error. For anasyncSwift implementation, there’s no reply handler; simply return the byte count or throw an error.