Struct LockedWriteHandle

Source
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§

Source§

impl<'handle, 'invoker, 'buffer, B: Buffer> LockedWriteHandle<'handle, 'invoker, 'buffer, B>

Source

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
Source

pub async fn write(&mut self, bytes: &[u8]) -> Result<(), Error>

Writes bytes to the file.

§Errors

Auto Trait Implementations§

§

impl<'handle, 'invoker, 'buffer, B> Freeze for LockedWriteHandle<'handle, 'invoker, 'buffer, B>

§

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§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.