mirror of
https://github.com/Momoko-Ayase/Senbei.git
synced 2026-11-24 10:52:47 +08:00
feat(io): add the hooks a desktop front end needs
A front end can now classify one input the way a single-file run dispatches it, count targets while a folder scan runs, read one package entry under the archive ceilings, splice a loader with its companion for viewing, and stamp live log lines with milliseconds. A RunObserver also sees each input's report before an inspection or dry run drops its outputs, so it can keep the restored bytes it wants. The CLI uses none of these, and its output is unchanged.
This commit is contained in:
1 parent
7ab381438f
commit
f0140cbf2b
6 files changed
+168
-6
No files matched your search
@@ -424,7 +424,7 @@ fn write_u32_at(buf: &mut [u8], off: usize, val: u32) {
|
||||
/// splice fires only when the first 32 bytes of `comp` equal the stub's header
|
||||
/// at offset 4096 — a 32-byte match on the key-table/magic region that confirms
|
||||
/// the pairing and leaves ordinary (non-companion) inputs untouched.
|
||||
pub(crate) fn splice_companion(stub: &[u8], comp: &[u8]) -> Option<Vec<u8>> {
|
||||
pub fn splice_companion(stub: &[u8], comp: &[u8]) -> Option<Vec<u8>> {
|
||||
let hdr_end = HEADER_OFF + 32;
|
||||
if stub.len() >= hdr_end && comp.len() >= 32 && stub[HEADER_OFF..hdr_end] == comp[..32] {
|
||||
let mut spliced = Vec::with_capacity(HEADER_OFF + comp.len());
|
||||
|
||||
Reference in new issue
Block a user