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.
Trait Implementations
impl Clone for ExtendedFileOptions
fn clone(&self) -> ExtendedFileOptions
impl Debug for ExtendedFileOptions
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>
impl Default for ExtendedFileOptions
fn default() -> ExtendedFileOptions
impl Eq for ExtendedFileOptions
impl PartialEq for ExtendedFileOptions
fn eq(&self, other: &ExtendedFileOptions) -> 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,
fn equivalent(&self, key: &K) -> bool
impl<Q, K> Equivalent<K> for ExtendedFileOptions
where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
fn equivalent(&self, key: &K) -> bool
impl<T> Any for ExtendedFileOptions
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for ExtendedFileOptions
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for ExtendedFileOptions
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for ExtendedFileOptions
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for ExtendedFileOptions
fn from(t: T) -> TReturns the argument unchanged.
impl<T> Same for ExtendedFileOptions
type Output = T;
impl<T> ToOwned for ExtendedFileOptions
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T, U> Into<U> for ExtendedFileOptions
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for ExtendedFileOptions
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for ExtendedFileOptions
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>