#[non_exhaustive]pub enum Platform {
Win32,
Ps3,
Ps4,
Unknown(u16),
}Expand description
Target platform for SqPack file path resolution.
FFXIV’s SqPack archive files live in platform-specific subdirectories
under the game install root. For example, a data file for the Windows
client lives at sqpack/ffxiv/000000.win32.dat0, while the PS4 equivalent
is sqpack/ffxiv/000000.ps4.dat0. The Platform value stored in an
ApplyConfig selects which suffix is used when resolving chunk targets
to filesystem paths.
§Default
An ApplyConfig defaults to Platform::Win32. Override this at
construction time with ApplyConfig::with_platform.
§Runtime override via SqpkTargetInfo
In practice, real FFXIV patch files begin with an SQPK T chunk
(SqpkTargetInfo) that declares the target platform. When
Chunk::apply is called on that chunk, it overwrites
ApplyConfig::platform with the decoded Platform value. This means
the default is only relevant for synthetic patches or when you know the
target in advance and want to assert it before the stream starts.
§Forward compatibility
The enum is #[non_exhaustive] because Square Enix has shipped console
targets on a sliding schedule (Win32, PS3, PS4) and a future PS5 / Switch
build would land here as a new named variant. The Platform::Unknown
variant preserves unrecognised platform IDs so that newer patch files do
not fail parsing when a new platform is introduced. Path resolution for SqPack
.dat/.index files refuses to guess and returns
ApplyError::UnsupportedPlatform carrying the raw platform_id —
silently substituting a default layout would risk writing platform-specific
data to the wrong file.
§Display
Implements std::fmt::Display: "Win32", "PS3", "PS4", or
"Unknown(N)" where N is the raw platform ID.
§Example
use zipatch_rs::{ApplyConfig, Platform};
let ctx = ApplyConfig::new("/opt/ffxiv/game")
.with_platform(Platform::Win32);
assert_eq!(ctx.platform(), Platform::Win32);
assert_eq!(format!("{}", Platform::Unknown(99)), "Unknown(99)");Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Win32
Windows / PC client (win32 path suffix).
This is the platform used by all current PC releases of FFXIV and is
the default for ApplyConfig.
Ps3
PlayStation 3 client (ps3 path suffix).
PS3 support was discontinued after FFXIV: A Realm Reborn. Patches targeting this platform are no longer issued by Square Enix, but the variant is retained for completeness.
Ps4
PlayStation 4 client (ps4 path suffix).
Active platform alongside Windows. PS4 patches share the same chunk structure as Windows patches but target different file paths.
Unknown(u16)
Unrecognised platform ID preserved from a SqpkTargetInfo chunk.
When the apply layer encounters a platform_id it does not recognise,
it stores the raw u16 value here and emits a warn! tracing event.
Subsequent SqPack path resolution returns
ApplyError::UnsupportedPlatform carrying the same u16 rather
than silently routing writes to a default layout — quietly substituting
win32 paths for an unknown platform would corrupt the on-disk install
with platform-specific data written to the wrong files. Non-SqPack
chunks (e.g. ADIR, DELD, or SqpkFile operations resolved via a
generic path) continue to apply, so an unknown platform only aborts at
the first .dat or .index lookup.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Platform
impl<'de> Deserialize<'de> for Platform
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Copy for Platform
impl Eq for Platform
impl StructuralPartialEq for Platform
Auto Trait Implementations§
impl Freeze for Platform
impl RefUnwindSafe for Platform
impl Send for Platform
impl Sync for Platform
impl Unpin for Platform
impl UnsafeUnpin for Platform
impl UnwindSafe for Platform
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> CustomError for T
impl<T> CustomError for T
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