Skip to main content

CziWriter

Struct CziWriter 

Source
pub struct CziWriter(/* private fields */);
Expand description

writer object.

Implementations§

Source§

impl CziWriter

Source

pub fn create<S: AsRef<str>>(options: S) -> Result<Self, Error>

Create a writer object for authoring a document in CZI-format. The options string is a JSON-formatted string, here is an example: \code { "allow_duplicate_subblocks" : true } \endcode

\param [out] writer_object If the operation is successful, a handle to the newly created writer object is put here. \param options A JSON-formatted zero-terminated string (in UTF8-encoding) containing options for the writer creation.

\returns An error-code indicating success or failure of the operation.

Source

pub fn init<S: AsRef<str>>( &self, output_stream: &OutputStream, parameters: S, ) -> Result<(), Error>

Initializes the writer object with the specified output stream object. The options string is a JSON-formatted string, here is an example: \code { "file_guid" : "123e4567-e89b-12d3-a456-426614174000", "reserved_size_attachments_directory" : 4096, "reserved_size_metadata_segment" : 50000, "minimum_m_index" : 0, "maximum_m_index" : 100 } \endcode

\param [out] writer_object If the operation is successful, a handle to the newly created writer object is put here. \param output_stream_object The output stream object to be used for writing the CZI data. \param parameters A JSON-formatted zero-terminated string (in UTF8-encoding) containing options for the writer initialization.

\returns An error-code indicating success or failure of the operation.

Source

pub fn add_sub_block( &self, add_sub_block_info: AddSubBlockInfo, ) -> Result<(), Error>

Add the specified sub-block to the writer object. The sub-block information is provided in the ‘add_sub_block_info_interop’ structure.

\param writer_object The writer object. \param add_sub_block_info_interop Information describing the sub-block to be added.

\returns An error-code indicating success or failure of the operation.

Source

pub fn add_attachement( &self, add_attachment_info: AddAttachmentInfo, ) -> Result<(), Error>

Add the specified attachment to the writer object. The attachment is provided in the ‘add_attachment_info_interop’ structure.

\param writer_object The writer object. \param add_attachment_info_interop Information describing the attachment to be added.

\returns An error-code indicating success or failure of the operation.

Source

pub fn write_metadata( &self, write_metadata_info: WriteMetadataInfo, ) -> Result<(), Error>

Add the specified metadata to the writer object. The metadata is provided in the ‘write_metadata_info_interop’ structure.

\param writer_object Handle to the writer object to which the metadata will be added. \param write_metadata_info_interop Information describing the metadata to be added.

\returns An error-code indicating success or failure of the operation.

Source

pub fn close(&self) -> Result<(), Error>

inalizes the CZI (i.e. writes out the final directory-segments) and closes the file. Note that this method must be called explicitly in order to get a valid CZI - calling ‘libCZI_ReleaseWriter’ without a prior call to this method will close the file immediately without finalization.

\param writer_object Handle to the writer object that is to be closed.

\returns An error-code indicating success or failure of the operation.

Source

pub fn release(&self) -> Result<(), Error>

Release the specified writer object.

\param writer_object Handle to the writer object that is to be released.

\returns An error-code indicating success or failure of the operation.

Trait Implementations§

Source§

impl Clone for CziWriter

Source§

fn clone(&self) -> CziWriter

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for CziWriter

Source§

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

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

impl Deref for CziWriter

Source§

type Target = i64

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl Drop for CziWriter

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.