#[non_exhaustive]pub enum SqpkCommand {
AddData(Box<SqpkAddData>),
DeleteData(SqpkDeleteData),
ExpandData(SqpkExpandData),
Header(SqpkHeader),
TargetInfo(SqpkTargetInfo),
File(Box<SqpkFile>),
Index(SqpkIndex),
PatchInfo(SqpkPatchInfo),
}Expand description
Sub-command of a SQPK chunk; the variant is selected by the command byte.
Each variant wraps the parsed body of its corresponding sub-command.
AddData and File are heap-allocated to keep the enum from inflating the
stack when used in iterators — SqpkAddData can carry a large inline data
Vec, and SqpkFile carries both a path and a Vec of compressed blocks.
Two variants — Index and PatchInfo — carry metadata consumed by the
indexed ZiPatch reader (not yet implemented) and have no direct filesystem
effect; their crate::apply::Apply arms return Ok(()) immediately.
Unknown sub-command bytes are never silently ignored: they surface as
ZiPatchError::UnknownSqpkCommand during parsing.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
AddData(Box<SqpkAddData>)
SQPK A — write a data payload into a .dat file at a block offset,
then zero a trailing range of blocks. See SqpkAddData.
DeleteData(SqpkDeleteData)
SQPK D — overwrite a contiguous block range with empty-block markers,
logically freeing those blocks in the SqPack archive. See SqpkDeleteData.
ExpandData(SqpkExpandData)
SQPK E — extend a .dat file into previously unallocated space by
writing empty-block markers. See SqpkExpandData.
Header(SqpkHeader)
SQPK H — write a 1024-byte SqPack header into a .dat or .index
file at offset 0 (version header) or 1024 (secondary header). See SqpkHeader.
TargetInfo(SqpkTargetInfo)
SQPK T — declares the target platform and region for all subsequent
path-resolution operations in this patch. See SqpkTargetInfo.
File(Box<SqpkFile>)
SQPK F — file-level operation: add a file from inline block payloads,
delete a file, remove all files in an expansion folder, or create a
directory tree. See SqpkFile and SqpkFileOperation.
Index(SqpkIndex)
SQPK I — add or remove a single SqPack index entry. Carries the
index hash and block location for use by the indexed ZiPatch reader;
has no direct apply effect. See SqpkIndex.
PatchInfo(SqpkPatchInfo)
SQPK X — patch install info: status, version, and declared post-patch
install size. Metadata only; not applied to the filesystem. See SqpkPatchInfo.
Trait Implementations§
Source§impl Apply for SqpkCommand
Dispatch an SqpkCommand to its specific apply function.
impl Apply for SqpkCommand
Dispatch an SqpkCommand to its specific apply function.
SqpkCommand::TargetInfo— updatesApplyContext::platformin place.SqpkCommand::IndexandSqpkCommand::PatchInfo— metadata only; returnsOk(())without touching the filesystem.- All other variants — delegate to the write/delete functions below.
Source§impl Clone for SqpkCommand
impl Clone for SqpkCommand
Source§fn clone(&self) -> SqpkCommand
fn clone(&self) -> SqpkCommand
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SqpkCommand
impl Debug for SqpkCommand
Source§impl PartialEq for SqpkCommand
impl PartialEq for SqpkCommand
Source§fn eq(&self, other: &SqpkCommand) -> bool
fn eq(&self, other: &SqpkCommand) -> bool
self and other values to be equal, and is used by ==.impl Eq for SqpkCommand
impl StructuralPartialEq for SqpkCommand
Auto Trait Implementations§
impl Freeze for SqpkCommand
impl RefUnwindSafe for SqpkCommand
impl Send for SqpkCommand
impl Sync for SqpkCommand
impl Unpin for SqpkCommand
impl UnsafeUnpin for SqpkCommand
impl UnwindSafe for SqpkCommand
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more