#[repr(C)]
pub struct FPDF_FILEHANDLER_ { pub clientData: *mut c_void, pub Release: Option<unsafe extern "C" fn(clientData: *mut c_void)>, pub GetSize: Option<unsafe extern "C" fn(clientData: *mut c_void) -> FPDF_DWORD>, pub ReadBlock: Option<unsafe extern "C" fn(clientData: *mut c_void, offset: FPDF_DWORD, buffer: *mut c_void, size: FPDF_DWORD) -> FPDF_RESULT>, pub WriteBlock: Option<unsafe extern "C" fn(clientData: *mut c_void, offset: FPDF_DWORD, buffer: *const c_void, size: FPDF_DWORD) -> FPDF_RESULT>, pub Flush: Option<unsafe extern "C" fn(clientData: *mut c_void) -> FPDF_RESULT>, pub Truncate: Option<unsafe extern "C" fn(clientData: *mut c_void, size: FPDF_DWORD) -> FPDF_RESULT>, }
Expand description

Structure for file reading or writing (I/O).

Note: This is a handler and should be implemented by callers, and is only used from XFA.

Fields

clientData: *mut c_void

User-defined data. Note: Callers can use this field to track controls.

Release: Option<unsafe extern "C" fn(clientData: *mut c_void)>

Callback function to release the current file stream object.

Parameters: clientData - Pointer to user-defined data. Returns: None.

GetSize: Option<unsafe extern "C" fn(clientData: *mut c_void) -> FPDF_DWORD>

Callback function to retrieve the current file stream size.

Parameters: clientData - Pointer to user-defined data. Returns: Size of file stream.

ReadBlock: Option<unsafe extern "C" fn(clientData: *mut c_void, offset: FPDF_DWORD, buffer: *mut c_void, size: FPDF_DWORD) -> FPDF_RESULT>

Callback function to read data from the current file stream.

Parameters: clientData - Pointer to user-defined data. offset - Offset position starts from the beginning of file stream. This parameter indicates reading position. buffer - Memory buffer to store data which are read from file stream. This parameter should not be NULL. size - Size of data which should be read from file stream, in bytes. The buffer indicated by |buffer| must be large enough to store specified data. Returns: 0 for success, other value for failure.

WriteBlock: Option<unsafe extern "C" fn(clientData: *mut c_void, offset: FPDF_DWORD, buffer: *const c_void, size: FPDF_DWORD) -> FPDF_RESULT>

Callback function to write data into the current file stream.

Parameters: clientData - Pointer to user-defined data. offset - Offset position starts from the beginning of file stream. This parameter indicates writing position. buffer - Memory buffer contains data which is written into file stream. This parameter should not be NULL. size - Size of data which should be written into file stream, in bytes. Returns: 0 for success, other value for failure.

Flush: Option<unsafe extern "C" fn(clientData: *mut c_void) -> FPDF_RESULT>

Callback function to flush all internal accessing buffers.

Parameters: clientData - Pointer to user-defined data. Returns: 0 for success, other value for failure.

Truncate: Option<unsafe extern "C" fn(clientData: *mut c_void, size: FPDF_DWORD) -> FPDF_RESULT>

Callback function to change file size.

Description: This function is called under writing mode usually. Implementer can determine whether to realize it based on application requests. Parameters: clientData - Pointer to user-defined data. size - New size of file stream, in bytes. Returns: 0 for success, other value for failure.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.