Skip to main content

ARAArchivingControllerInterface

Struct ARAArchivingControllerInterface 

Source
#[repr(C, packed(1))]
pub struct ARAArchivingControllerInterface { pub structSize: ARASize, pub getArchiveSize: Option<unsafe extern "C" fn(controllerHostRef: ARAArchivingControllerHostRef, archiveReaderHostRef: ARAArchiveReaderHostRef) -> ARASize>, pub readBytesFromArchive: Option<unsafe extern "C" fn(controllerHostRef: ARAArchivingControllerHostRef, archiveReaderHostRef: ARAArchiveReaderHostRef, position: ARASize, length: ARASize, buffer: *mut ARAByte) -> ARABool>, pub writeBytesToArchive: Option<unsafe extern "C" fn(controllerHostRef: ARAArchivingControllerHostRef, archiveWriterHostRef: ARAArchiveWriterHostRef, position: ARASize, length: ARASize, buffer: *const ARAByte) -> ARABool>, pub notifyDocumentArchivingProgress: Option<unsafe extern "C" fn(controllerHostRef: ARAArchivingControllerHostRef, value: f32)>, pub notifyDocumentUnarchivingProgress: Option<unsafe extern "C" fn(controllerHostRef: ARAArchivingControllerHostRef, value: f32)>, pub getDocumentArchiveID: Option<unsafe extern "C" fn(controllerHostRef: ARAArchivingControllerHostRef, archiveReaderHostRef: ARAArchiveReaderHostRef) -> ARAPersistentID>, }
Expand description

! Host interface: archive controller. ! As with all host interfaces, the function pointers in this struct must remain valid until ! all document controllers on the plug-in side that use it have been destroyed.

Fields§

§structSize: ARASize

! @see_Versioned_Structs_

§getArchiveSize: Option<unsafe extern "C" fn(controllerHostRef: ARAArchivingControllerHostRef, archiveReaderHostRef: ARAArchiveReaderHostRef) -> ARASize>

! Query the size of the archive. ! This may only be called from ARADocumentControllerInterface::restoreObjectsFromArchive(), ! or if using API generation 1 from the deprecated begin-/endRestoringDocumentFromArchive() calls. ! Plug-ins must respect this size when reading the archive, reading beyond the end of the data ! is a programming error (and should thus be asserted by the host).

§readBytesFromArchive: Option<unsafe extern "C" fn(controllerHostRef: ARAArchivingControllerHostRef, archiveReaderHostRef: ARAArchiveReaderHostRef, position: ARASize, length: ARASize, buffer: *mut ARAByte) -> ARABool>

! Read bytes. ! This may only be called from ARADocumentControllerInterface::restoreObjectsFromArchive(), ! or if using API generation 1 from the deprecated begin-/endRestoringDocumentFromArchive() calls. ! Result is kARATrue upon success, or kARAFalse when there is a critical, nonrecoverable ! I/O error, such as a network failure while the file is being read from a server. ! In case of failing in this call, the host must notify the user about the problem in some ! appropriate way. The archive will not be restored by the plug-in then, it’ll fall back into ! some proper initial state for the affected objects.

§writeBytesToArchive: Option<unsafe extern "C" fn(controllerHostRef: ARAArchivingControllerHostRef, archiveWriterHostRef: ARAArchiveWriterHostRef, position: ARASize, length: ARASize, buffer: *const ARAByte) -> ARABool>

! Write bytes. ! This may only be called from storeObjectsToArchive() or the deprecated storeDocumentToArchive(). ! Result is kARATrue upon success, or kARAFalse when there is a critical, nonrecoverable ! I/O error, such as a network failure while the file is being written to a server. ! In case of failing in this call, the host must notify the user about the problem in an appropriate way. ! \br ! Note that a plug-in should strive to write the data consecutively in a stream-like manner. ! Nevertheless, repositioning is needed to support chunk-style archives where the chunk length ! must be specified at the start of the chunk, but is not known until the chunk data has been ! fully created (and possibly compressed). In that case, the plug-in will need to “rewind” to ! the chunk size entry in the chunk header after writing the chunk and update it accordingly. ! As in most file APIs, any range of bytes that was skipped when writing should be filled with ! 0 by the host.

§notifyDocumentArchivingProgress: Option<unsafe extern "C" fn(controllerHostRef: ARAArchivingControllerHostRef, value: f32)>

! Message to the host signaling document save progress, value ranges from 0.0f to 1.0f. ! This may only be called from storeObjectsToArchive() or from the deprecated storeDocumentToArchive(). ! In order to keep CPU load low, plug-ins should try to keep the update rate for this call ! as low as about 1000 calls per archive, which equals increments of 0.1%.

§notifyDocumentUnarchivingProgress: Option<unsafe extern "C" fn(controllerHostRef: ARAArchivingControllerHostRef, value: f32)>

! Message to the host signaling document save progress, value ranges from 0.0f to 1.0f. ! This may only be called from ARADocumentControllerInterface::restoreObjectsFromArchive(), ! or if using API generation 1 from the deprecated begin-/endRestoringDocumentFromArchive() ! and the associated model object creation/update calls guarded by them. In the deprecated form, ! the first call should be made from begin- and the last call from endRestoringDocumentFromArchive(). ! In order to keep CPU load low, plug-ins should try to keep the update rate for this call ! as low as about 1000 calls per archive, which equals increments of 0.1%.

§getDocumentArchiveID: Option<unsafe extern "C" fn(controllerHostRef: ARAArchivingControllerHostRef, archiveReaderHostRef: ARAArchiveReaderHostRef) -> ARAPersistentID>

! Query the document archive ID that the plug-in’s factory provided when saving the archive. ! This may only be called from ARADocumentControllerInterface::restoreObjectsFromArchive(). ! Plug-ins can use this information to optimize their unarchiving code in case different ! archive formats are used depending on document archive ID. ! The returned pointer is owned by the host and must remain valid until the archive reader ! is destroyed. ! All hosts that support kARAAPIGeneration_2_0_Final or newer must implement this call.

Trait Implementations§

Source§

impl Clone for ARAArchivingControllerInterface

Source§

fn clone(&self) -> ARAArchivingControllerInterface

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ARAArchivingControllerInterface

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Copy for ARAArchivingControllerInterface

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.