pub struct OpenXmlPackage { /* private fields */ }
Expand description

A common OpenXML package manager, compatible with any OpenXML Package Convertion

FIXME(@zitsen): A dirty dict representing data change should be added.

Implementations§

source§

impl OpenXmlPackage

source

pub fn open<P: AsRef<Path>>(path: P) -> Result<Self, OoxmlError>

Open a OpenXML file path, parse everything into the memory.

source

pub fn from_reader<R: Read + Seek>(reader: R) -> Result<Self, OoxmlError>

Parse OpenXML package from reader.

source

pub fn save_as<P: AsRef<Path>>(&self, path: P) -> Result<(), OoxmlError>

Save as file, write zip package for office document.

source

pub fn write<W: Write + Seek>(&self, writer: W) -> Result<(), OoxmlError>

source

pub fn has_content_types(&self) -> bool

source

pub fn has_relationships(&self) -> bool

source

pub fn is_dirty(&self, _uri: &str) -> bool

A part is dirty if data has been changed.

source

pub fn get_part(&self, uri: &str) -> Option<&OpenXmlPart>

Get OpenXML Part by uri.

source

pub fn create_part()

source

pub fn flush()

source

pub fn create_relationship()

source

pub fn delete_relationship()

source

pub fn get_relationships()

source

pub fn get_relationships_by_type(_relationship_type: String)

source

pub fn relationship_exist(&self, id: &str) -> bool

source

pub fn create_part_core(&mut self, uri: &str, content_type: &ContentType)

source

pub fn create_part_core_with_data( &mut self, uri: &str, content_type: &ContentType, data: &[u8] ) -> Result<(), OoxmlError>

source

pub fn delete_part_core(&mut self, uri: &str)

Delete the part corresponding to the uri specified.

Delete the content type for this part if it was specified as an override.

Trait Implementations§

source§

impl Clone for OpenXmlPackage

source§

fn clone(&self) -> OpenXmlPackage

Returns a copy 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 OpenXmlPackage

source§

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

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

impl Default for OpenXmlPackage

source§

fn default() -> OpenXmlPackage

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.