Skip to main content

Hooks

Struct Hooks 

Source
pub struct Hooks<'a> {
    pub copied: &'a mut dyn FnMut(u8),
    pub progress: &'a mut dyn FnMut(u64, u64),
    pub needed: &'a mut dyn FnMut(u64, u64),
    pub consumed: &'a mut dyn FnMut(u64, u64),
    pub settle: &'a mut dyn FnMut(&mut dyn Write) -> Result<(), Error>,
}
Expand description

What assemble_with reports while it writes.

Fields§

§copied: &'a mut dyn FnMut(u8)

Called once each data section (a kind of DICT_DATA, INDEX_DATA, QUAD_DATA, LABEL_DATA, TEXT_DATA or PYRAMID) is in the output: the input bytes it came from are not read again.

§progress: &'a mut dyn FnMut(u64, u64)

(data bytes written so far, data bytes in all), after each write.

§needed: &'a mut dyn FnMut(u64, u64)

(input offset, length) of every payload range the copy will read, announced once before the first byte is written.

§consumed: &'a mut dyn FnMut(u64, u64)

(input offset, length) of a payload range now in the output, whatever order the ranges come in. Once every announced range of a spill file has been consumed, nothing reads that file again.

§settle: &'a mut dyn FnMut(&mut dyn Write) -> Result<(), Error>

Called with the output after every copied run and every finished data section, once consumed / copied may have made spill files ready to go. The implementation flushes out, makes the bytes durable, and only then deletes: a file must never be removed while its bytes are still in a buffer or an unsynced page.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Hooks<'a>

§

impl<'a> !Send for Hooks<'a>

§

impl<'a> !Sync for Hooks<'a>

§

impl<'a> !UnwindSafe for Hooks<'a>

§

impl<'a> Freeze for Hooks<'a>

§

impl<'a> Unpin for Hooks<'a>

§

impl<'a> UnsafeUnpin for Hooks<'a>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V