pub struct Binarizer { /* private fields */ }Expand description
Binarizes models with BI’s binarize.exe. Owns the Proton sandbox (if any) and removes it on drop.
Implementations§
Source§impl Binarizer
impl Binarizer
Sourcepub fn new(backend: BinarizeBackend) -> Result<Binarizer, Error>
pub fn new(backend: BinarizeBackend) -> Result<Binarizer, Error>
Creates a binarizer; the Proton sandbox is only built when the first model is binarized.
§Errors
Returns an error if the backend is not available on this platform.
Sourcepub fn binarize(
&mut self,
input: &Path,
addon_root: &Path,
prefix: &str,
warnings: &mut dyn WarningSink,
) -> Result<Vec<u8>, Error>
pub fn binarize( &mut self, input: &Path, addon_root: &Path, prefix: &str, warnings: &mut dyn WarningSink, ) -> Result<Vec<u8>, Error>
Binarizes the given path with BI’s binarize.exe.
addon_root is the folder the addon is built from and prefix its PBO prefix: binarize.exe
resolves texture references (prefix\data\x.paa) relative to its current directory, so the
addon is made available at P:\<prefix>.
§Errors
Returns an error if Proton or binarize.exe fails.
Source§impl Binarizer
impl Binarizer
Sourcepub fn close(self, warnings: &mut dyn WarningSink) -> Result<(), Error>
pub fn close(self, warnings: &mut dyn WarningSink) -> Result<(), Error>
Removes the Proton sandbox now. A sandbox that cannot be removed is reported as a note in
warnings (the build is not failed for it). Call this on every exit path: Drop is only
the silent fallback.
§Errors
Never fails today; the result leaves room for backends whose cleanup can fail.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Binarizer
impl RefUnwindSafe for Binarizer
impl Send for Binarizer
impl Sync for Binarizer
impl Unpin for Binarizer
impl UnsafeUnpin for Binarizer
impl UnwindSafe for Binarizer
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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