Skip to main content

ApplyContext

Struct ApplyContext 

Source
pub struct ApplyContext { /* private fields */ }
Expand description

Apply-time state: install root, target platform, flag toggles, and the internal file-handle cache used by SQPK writers.

Construct with ApplyContext::new and customise with the with_* builder methods. SqpkTargetInfo chunks may overwrite the platform field at apply time; ApplyOption chunks may overwrite the ignore-flags.

Implementations§

Source§

impl ApplyContext

Source

pub fn new(game_path: impl Into<PathBuf>) -> Self

Create a context targeting the given game install directory.

Defaults: platform is Platform::Win32, both ignore-flags are off.

Source

pub fn game_path(&self) -> &Path

Returns the game installation directory.

Source

pub fn platform(&self) -> Platform

Returns the current target platform.

Source

pub fn ignore_missing(&self) -> bool

Returns whether missing files are silently ignored during apply.

Source

pub fn ignore_old_mismatch(&self) -> bool

Returns whether old-data mismatches are silently ignored during apply.

Source

pub fn with_platform(self, platform: Platform) -> Self

Sets the target platform. Defaults to Platform::Win32. Note: SqpkTargetInfo chunks in the patch stream will override this at apply time.

Source

pub fn with_ignore_missing(self, v: bool) -> Self

Silently ignore missing files instead of returning an error during apply.

Source

pub fn with_ignore_old_mismatch(self, v: bool) -> Self

Silently ignore old-data mismatches instead of returning an error during apply.

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

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

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more