objc2_fs_kit/generated/
FSMutableFileDataBuffer.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6
7use crate::*;
8
9extern_class!(
10    /// A wrapper object for a data buffer.
11    ///
12    /// This object provides a "zero-copy" buffer, for use when reading data from files.
13    /// By not requiring additional buffer copying, this object reduces the extension's memory footprint and improves performance.
14    /// The `FSMutableFileDataBuffer` behaves similarly to a `uio` in the kernel.
15    ///
16    /// See also [Apple's documentation](https://developer.apple.com/documentation/fskit/fsmutablefiledatabuffer?language=objc)
17    #[unsafe(super(NSObject))]
18    #[derive(Debug, PartialEq, Eq, Hash)]
19    pub struct FSMutableFileDataBuffer;
20);
21
22extern_conformance!(
23    unsafe impl NSObjectProtocol for FSMutableFileDataBuffer {}
24);
25
26impl FSMutableFileDataBuffer {
27    extern_methods!(
28        /// The data length of the buffer.
29        #[unsafe(method(length))]
30        #[unsafe(method_family = none)]
31        pub unsafe fn length(&self) -> NSUInteger;
32
33        #[unsafe(method(init))]
34        #[unsafe(method_family = init)]
35        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
36
37        /// The byte data.
38        #[unsafe(method(mutableBytes))]
39        #[unsafe(method_family = none)]
40        pub unsafe fn mutableBytes(&self) -> NonNull<c_void>;
41    );
42}
43
44/// Methods declared on superclass `NSObject`.
45impl FSMutableFileDataBuffer {
46    extern_methods!(
47        #[unsafe(method(new))]
48        #[unsafe(method_family = new)]
49        pub unsafe fn new() -> Retained<Self>;
50    );
51}