pub struct UserOriginal { /* private fields */ }Expand description
A user’s original: a file outside coven’s directories, at the path the app named for it, which coven reads and never changes (§17.3). It is made where the app’s call hands the path in, or where coven reads back the path it recorded.
Implementations§
Source§impl UserOriginal
impl UserOriginal
Sourcepub async fn observe(
&self,
place: LeasePlace,
consume: impl FnMut(&[u8]),
) -> Result<ObservedFile, ObservationError>
pub async fn observe( &self, place: LeasePlace, consume: impl FnMut(&[u8]), ) -> Result<ObservedFile, ObservationError>
Read it once in bounded chunks, in place, checking its handle and
path before returning. The consumer can hash the bytes and report
progress. The place goes back when the read ends.
Sourcepub fn open_reader(
&self,
place: LeasePlace,
size: u64,
modified: SystemTime,
) -> Result<FileReader, ObservationError>
pub fn open_reader( &self, place: LeasePlace, size: u64, modified: SystemTime, ) -> Result<FileReader, ObservationError>
Open it in place for positioned reads and check its size and
modification time, once: later reads return what’s on disk. The place
goes back when the reader drops.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for UserOriginal
impl RefUnwindSafe for UserOriginal
impl Send for UserOriginal
impl Sync for UserOriginal
impl Unpin for UserOriginal
impl UnsafeUnpin for UserOriginal
impl UnwindSafe for UserOriginal
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