pub struct WriteableCab(/* private fields */);Expand description
A shared, appendable resource writer. Clones refer to the same bytes.
Implementations§
Source§impl WriteableCab
impl WriteableCab
Sourcepub fn new(
name: RawStr,
flags: u32,
endian: Endian,
meter: &Arc<Meter>,
) -> Result<Self, SaveError>
pub fn new( name: RawStr, flags: u32, endian: Endian, meter: &Arc<Meter>, ) -> Result<Self, SaveError>
Create an empty writer owned by a caller-managed file mapping. The caller supplies resource metadata from its current mapping.
Sourcepub fn path(&self) -> Option<RawStr>
pub fn path(&self) -> Option<RawStr>
The archive path installed by the last SerializedFile caller.
Sourcepub fn write_bytes(&self, bytes: &[u8]) -> Result<u64, SaveError>
pub fn write_bytes(&self, bytes: &[u8]) -> Result<u64, SaveError>
Append bytes, returning their starting offset. A refusal leaves bytes intact.
Sourcepub fn write_at(&self, offset: u64, bytes: &[u8]) -> Result<(), SaveError>
pub fn write_at(&self, offset: u64, bytes: &[u8]) -> Result<(), SaveError>
Write at a caller-selected cursor, retaining the tail and zero-filling any gap. A refused growth or work charge leaves the bytes unchanged.
Sourcepub fn write_zeroes_at(
&self,
offset: u64,
count: usize,
) -> Result<(), SaveError>
pub fn write_zeroes_at( &self, offset: u64, count: usize, ) -> Result<(), SaveError>
Write zero padding at a selected cursor, charging before growth.
Trait Implementations§
Source§impl Clone for WriteableCab
impl Clone for WriteableCab
Auto Trait Implementations§
impl !RefUnwindSafe for WriteableCab
impl !UnwindSafe for WriteableCab
impl Forget for WriteableCab
impl Freeze for WriteableCab
impl Move for WriteableCab
impl Send for WriteableCab
impl Sync for WriteableCab
impl Unpin for WriteableCab
impl UnsafeUnpin for WriteableCab
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