Struct ExtendedFileOptions

pub struct ExtendedFileOptions { /* private fields */ }

The Extension for Extra Data and Central Extra Data

Implementations

impl ExtendedFileOptions

fn add_extra_data<D: AsRef<[u8]>>(&mut self, header_id: u16, data: D, central_only: bool) -> ZipResult<()>

Adds an extra data field, unless we detect that it's invalid.

Parameters

  • header_id – The 2‑byte identifier of the ZIP extra field to add. This value determines the type/format of data and should either be one of the standard ZIP extra field IDs defined by the ZIP specification or an application‑specific (vendor) ID.
  • data – The raw payload for the extra field, without the leading header ID or length; those are derived from header_id and data.len() and written automatically.
  • central_only – Controls where the extra field is stored:
    • When true, the field is appended only to the central directory extra data (central_extra_data), and the corresponding local file header is left unchanged.
    • When false, the field is appended to the local file header extra data (extra_data) and may also be reflected in the central directory, depending on how the ZIP is written.

The combined size of all extra data (local + central) must not exceed u16::MAX. If adding this field would exceed that limit or produce an invalid extra data structure, an error is returned and no data is added.

fn add_extra_field<D: AsRef<[u8]>>(&mut self, header_id: u16, data: D, central_only: bool) -> ZipResult<()>

Adds an extra field, unless we detect that it's invalid.

Parameters

  • header_id – The 2‑byte identifier of the ZIP extra field to add. This value determines the type/format of data and should either be one of the standard ZIP extra field IDs defined by the ZIP specification or an application‑specific (vendor) ID.
  • data – The raw payload for the extra field, without the leading header ID or length; those are derived from header_id and data.len() and written automatically.
  • central_only – Controls where the extra field is stored:
    • When true, the field is appended only to the central directory extra data (central_extra_data), and the corresponding local file header is left unchanged.
    • When false, the field is appended to the local file header extra data (extra_data) and may also be reflected in the central directory, depending on how the ZIP is written.

The combined size of all extra data (local + central) must not exceed u16::MAX. If adding this field would exceed that limit or produce an invalid extra data structure, an error is returned and no data is added.

Trait Implementations

impl Clone for ExtendedFileOptions

fn clone(&self) -> Self

impl Debug for ExtendedFileOptions

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

impl Default for ExtendedFileOptions

fn default() -> Self

impl Eq for ExtendedFileOptions

impl PartialEq for ExtendedFileOptions

fn eq(&self, other: &Self) -> bool

impl StructuralPartialEq for ExtendedFileOptions

Auto Trait Implementations

impl Freeze for ExtendedFileOptions

impl RefUnwindSafe for ExtendedFileOptions

impl Send for ExtendedFileOptions

impl Sync for ExtendedFileOptions

impl Unpin for ExtendedFileOptions

impl UnsafeUnpin for ExtendedFileOptions

impl UnwindSafe for ExtendedFileOptions

Blanket Implementations

impl<Q, K> Equivalent<K> for ExtendedFileOptions where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

impl<Q, K> Equivalent<K> for ExtendedFileOptions where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

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

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

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

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

impl<T> From<T> for ExtendedFileOptions

impl<T> Same for ExtendedFileOptions

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

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

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

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