pub struct Writer {
pub data: Vec<u8>,
pub wide_strings: bool,
/* private fields */
}Expand description
The writing side of Reader (IO::BinaryWriter): little-endian values, 8-bit strings and
blocks whose size is filled in when they close.
Fields§
§data: Vec<u8>The bytes written.
wide_strings: boolWrite System::Strings as UTF-16 (as older builds did) instead of 8-bit.
Implementations§
Source§impl Writer
impl Writer
Sourcepub fn set_reference_ids(&mut self, ids: &BTreeMap<u32, String>)
pub fn set_reference_ids(&mut self, ids: &BTreeMap<u32, String>)
Write external pointers as reference ids (the inverse of the reference table).
Sourcepub fn string(&mut self, s: &str)
pub fn string(&mut self, s: &str)
System::String with the 8-bit flag (or UTF-16 with Writer::wide_strings); the
length counts the NUL.
Sourcepub fn wstring(&mut self, s: &str)
pub fn wstring(&mut self, s: &str)
A UTF-16 string: the unit count with its NUL, then the units.
Sourcepub fn external_ref(&mut self, path: Option<&str>) -> Result<()>
pub fn external_ref(&mut self, path: Option<&str>) -> Result<()>
ExternalPtr, in reference mode an id (u32::MAX for none), else a present flag and
the path.
Sourcepub fn begin_block(&mut self, version: u32) -> usize
pub fn begin_block(&mut self, version: u32) -> usize
Open a block at version; returns where its size goes, for Writer::end_block.
Trait Implementations§
Auto Trait Implementations§
impl Freeze 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