pub struct LockedReadHandle<'handle, 'invoker, 'buffer, B: Buffer> { /* private fields */ }
Expand description

A readable file handle on which methods can be invoked.

This type combines a readable 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 ReadHandle::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

Seeks to a position in the file and returns the resulting absolute byte position.

Errors

Reads bytes from the file.

None is returned if no bytes were read because the handle’s initial position was at or beyond EOF.

The returned byte slice points into, and therefore retains ownership of, the scratch buffer. Consequently, the LockedReadHandle is consumed and cannot be reused.

Errors

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.