pub struct Writer {
pub buffer: Vec<u8>,
pub id: u32,
pub extra: i64,
}Expand description
growable utf-8 buffer
Fields§
§buffer: Vec<u8>the written bytes
id: u32unique id of the content of the writer: it changes when the writer is reset
extra: i64number of bytes written minus the number of UTF-16 code units of the written strings
Implementations§
Source§impl Writer
impl Writer
pub fn new(capacity: usize) -> Self
Sourcepub fn write_byte(&mut self, code: u8)
pub fn write_byte(&mut self, code: u8)
write an ascii character
Sourcepub fn copy(&mut self, start: usize, end: usize, extra: i64)
pub fn copy(&mut self, start: usize, end: usize, extra: i64)
copy bytes already written to the end of the buffer
Sourcepub fn code_length(&self) -> usize
pub fn code_length(&self) -> usize
length of the written css once decoded, in UTF-16 code units
Sourcepub fn into_bytes(self) -> Vec<u8> ⓘ
pub fn into_bytes(self) -> Vec<u8> ⓘ
take the written bytes
Trait Implementations§
Auto Trait Implementations§
impl Forget for Writer
impl Freeze for Writer
impl Move for Writer
impl RefUnwindSafe for Writer
impl Send for Writer
impl Sync for Writer
impl Unpin for Writer
impl UnsafeUnpin for Writer
impl UnwindSafe for Writer
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