pub struct DirtyInput {
pub original_range: Range<u64>,
pub reader: Pin<Box<dyn AsyncRead + Send>>,
pub new_length: u64,
}Expand description
A single edit applied to the original file: replace original_range with new_length
bytes from reader.
All three combinations are supported:
original_range.len() == new_length→ in-place edit (no file size change).original_range.len() != new_length→ resize edit (file grows or shrinks).original_range.start == original_range.end→ pure insert at that position.new_length == 0→ pure delete oforiginal_range.
Pure append at end of file is { original_range: original_size..original_size, new_length: N, reader: ... }.
Pure truncate-to-N is { original_range: N..original_size, new_length: 0, reader: empty }.
Fields§
§original_range: Range<u64>§reader: Pin<Box<dyn AsyncRead + Send>>§new_length: u64Auto Trait Implementations§
impl !RefUnwindSafe for DirtyInput
impl !Sync for DirtyInput
impl !UnwindSafe for DirtyInput
impl Freeze for DirtyInput
impl Send for DirtyInput
impl Unpin for DirtyInput
impl UnsafeUnpin for DirtyInput
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
Source§impl<T> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more