pub struct LocalFileStream { /* private fields */ }Expand description
An open local file checked against its recorded facts. Retaining it keeps the opened bytes readable across its upload completing and file unlinking, and prevents store deletion until its reads and handles have finished.
Implementations§
Source§impl LocalFileStream
impl LocalFileStream
Sourcepub fn plaintext_size(&self) -> u64
pub fn plaintext_size(&self) -> u64
The complete plaintext byte count.
Sourcepub async fn read_at(
&self,
offset: u64,
len: u64,
) -> Result<Vec<u8>, LocalFileError>
pub async fn read_at( &self, offset: u64, len: u64, ) -> Result<Vec<u8>, LocalFileError>
Read a positioned range on a blocking worker, retaining this open handle. A caller that stops waiting leaves the read to finish, and its panic goes to the store’s bug sink (E15).
Sourcepub async fn read_verified_at(
&self,
offset: u64,
len: u64,
expected: ContentHash,
) -> Result<Vec<u8>, LocalFileError>
pub async fn read_verified_at( &self, offset: u64, len: u64, expected: ContentHash, ) -> Result<Vec<u8>, LocalFileError>
Read a complete plaintext chunk and compare its first-read hash before returning any bytes to an encryptor. Metadata checks alone cannot detect a same-size overwrite whose modification time was restored.
Auto Trait Implementations§
impl Freeze for LocalFileStream
impl !RefUnwindSafe for LocalFileStream
impl Send for LocalFileStream
impl Sync for LocalFileStream
impl Unpin for LocalFileStream
impl UnsafeUnpin for LocalFileStream
impl !UnwindSafe for LocalFileStream
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