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 ofdataand 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 fromheader_idanddata.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.
- When
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 ofdataand 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 fromheader_idanddata.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.
- When
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