pub struct DscEncoder<'a, T: Write + Seek> {
stream: MsbBitWriter<'a, BufWriter<T>>,
magic: u32,
key: u32,
dec_count: u32,
level: u8,
}Available on crate features
bgi and bgi-arc only.Expand description
Encoder for Buriko General Interpreter/Ethornell compressed files (DSC format).
Fields§
§stream: MsbBitWriter<'a, BufWriter<T>>§magic: u32§key: u32§dec_count: u32§level: u8Implementations§
Source§impl<'a, T: Write + Seek> DscEncoder<'a, T>
impl<'a, T: Write + Seek> DscEncoder<'a, T>
Sourcepub fn new(writer: &'a mut BufWriter<T>, level: u8) -> Self
pub fn new(writer: &'a mut BufWriter<T>, level: u8) -> Self
Creates a new DscEncoder with the given writer and compression level (0-10).
Sourcepub fn pack(self, data: &[u8]) -> Result<()>
pub fn pack(self, data: &[u8]) -> Result<()>
Packs the given data into the DSC format using configured LZSS compression.
fn update_key(&mut self) -> u8
Auto Trait Implementations§
impl<'a, T> Freeze for DscEncoder<'a, T>
impl<'a, T> RefUnwindSafe for DscEncoder<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for DscEncoder<'a, T>where
T: Send,
impl<'a, T> Sync for DscEncoder<'a, T>where
T: Sync,
impl<'a, T> Unpin for DscEncoder<'a, T>
impl<'a, T> !UnwindSafe for DscEncoder<'a, T>
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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