pub struct PlainText { /* private fields */ }Expand description
represents the uncompressed data, including a prefix that is may be referenced by the compressed data. The prefix data is only visible via the PreflateInput struct.
Implementations§
Source§impl PlainText
impl PlainText
pub fn new() -> Self
Sourcepub fn shrink_to_dictionary(&mut self)
pub fn shrink_to_dictionary(&mut self)
returns the dictionary to be used as a prefix for the next compression, which is a maximum of 32KB in size.
pub fn new_with_data(data: Vec<u8>) -> Self
pub fn len(&self) -> usize
Sourcepub fn total_length(&self) -> u32
pub fn total_length(&self) -> u32
the total length of the data from the beginning
pub fn prefix(&self) -> &[u8] ⓘ
pub fn truncate(&mut self, len: usize)
pub fn push(&mut self, c: u8)
pub fn append(&mut self, data: &[u8])
pub fn append_iter(&mut self, data: impl Iterator<Item = u8>)
Sourcepub fn append_reference(&mut self, dist: u32, len: u32) -> Result<()>
pub fn append_reference(&mut self, dist: u32, len: u32) -> Result<()>
writes a reference to the buffer, which copies the text from a previous location to the current location. In most cases this is non-overlapping, but there are some cases where there is overlap between the source and destination.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PlainText
impl RefUnwindSafe for PlainText
impl Send for PlainText
impl Sync for PlainText
impl Unpin for PlainText
impl UnsafeUnpin for PlainText
impl UnwindSafe for PlainText
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