pub struct ContentTypes {
pub defaults: HashMap<String, String>,
pub overrides: HashMap<String, String>,
}Expand description
Parsed [Content_Types].xml.
Fields§
§defaults: HashMap<String, String>§overrides: HashMap<String, String>Implementations§
Source§impl ContentTypes
impl ContentTypes
Sourcepub fn content_type_for(&self, part_name: &str) -> Option<&str>
pub fn content_type_for(&self, part_name: &str) -> Option<&str>
Look up the content type for a given part name.
Sourcepub fn add_default(&mut self, extension: &str, content_type: &str)
pub fn add_default(&mut self, extension: &str, content_type: &str)
Add a default content type for an extension (e.g., “png” -> “image/png”).
Sourcepub fn add_override(&mut self, part_name: &str, content_type: &str)
pub fn add_override(&mut self, part_name: &str, content_type: &str)
Add an override content type for a specific part name.
Sourcepub fn minimal() -> ContentTypes
pub fn minimal() -> ContentTypes
Create the minimal content types shared by every OPC package.
Trait Implementations§
Source§impl Clone for ContentTypes
impl Clone for ContentTypes
Source§fn clone(&self) -> ContentTypes
fn clone(&self) -> ContentTypes
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ContentTypes
impl RefUnwindSafe for ContentTypes
impl Send for ContentTypes
impl Sync for ContentTypes
impl Unpin for ContentTypes
impl UnsafeUnpin for ContentTypes
impl UnwindSafe for ContentTypes
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more