pub struct LockedWriteHandle<'handle, 'invoker, 'buffer, B: Buffer> { /* private fields */ }Expand description
A writeable file handle on which methods can be invoked.
This type combines a writeable file handle, an Invoker that can be used to make
method calls, and a scratch buffer used to perform CBOR encoding and decoding. A value of this
type can be created by calling WriteHandle::lock, and it can be dropped to
return the borrow of the invoker and buffer to the caller so they can be reused for other
purposes.
The 'handle lifetime is the lifetime of the original file handle. The 'invoker lifetime is
the lifetime of the invoker. The 'buffer lifetime is the lifetime of the buffer. The B type
is the type of scratch buffer to use.
Implementations
sourceimpl<'handle, 'invoker, 'buffer, B: Buffer> LockedWriteHandle<'handle, 'invoker, 'buffer, B>
impl<'handle, 'invoker, 'buffer, B: Buffer> LockedWriteHandle<'handle, 'invoker, 'buffer, B>
sourcepub async fn seek(&mut self, basis: Seek, offset: i64) -> Result<u64, Error>
pub async fn seek(&mut self, basis: Seek, offset: i64) -> Result<u64, Error>
Seeks to a position in the file and returns the resulting absolute byte position.
Errors
sourcepub async fn write(&mut self, bytes: &[u8]) -> Result<(), Error>
pub async fn write(&mut self, bytes: &[u8]) -> Result<(), Error>
Writes bytes to the file.
Errors
BadComponentDataTooLargeif the disk is out of spaceNotEnoughEnergy
Auto Trait Implementations
impl<'handle, 'invoker, 'buffer, B> RefUnwindSafe for LockedWriteHandle<'handle, 'invoker, 'buffer, B> where
B: RefUnwindSafe,
impl<'handle, 'invoker, 'buffer, B> Send for LockedWriteHandle<'handle, 'invoker, 'buffer, B> where
B: Send,
impl<'handle, 'invoker, 'buffer, B> Sync for LockedWriteHandle<'handle, 'invoker, 'buffer, B> where
B: Sync,
impl<'handle, 'invoker, 'buffer, B> Unpin for LockedWriteHandle<'handle, 'invoker, 'buffer, B>
impl<'handle, 'invoker, 'buffer, B> !UnwindSafe for LockedWriteHandle<'handle, 'invoker, 'buffer, B>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more