selfie
selfie copied to clipboard
python: `to_be_file`
This is different than to_match_disk. "MatchDisk" has a special file format, garbage-collection, lots of fancy features. to_be_file is only for a single binary facet, it writes the binary to disk unchanged.
The demo that this unlocks is AI image generation, where you can open the snapshot without any extra tooling. Jus ttsay to_be_file("test.jpg") and you can just open the file.
The beginning of it is here:
- https://github.com/diffplug/selfie/blob/c757b1c0184f0263c3ea248f44ed1680c8e81c8d/jvm/selfie-lib/src/commonMain/kotlin/com/diffplug/selfie/guts/WriteTracker.kt#L106-L144
- [x] basic
to_be_fileimplementation #366 - [x] needs
expect_selfie(actual: bytes) -> BinarySelfie- means
BinaryFacet
- means
- [x] needs
cache_selfie_binary-
def cache_selfie_binary(to_cache: Cacheable[bytes]) -> CacheSelfieBinary[bytes]: ... def cache_selfie_binary(to_cache: Cacheable[T], roundtrip: CacheSelfie[T, bytes]) -> CacheSelfieBinary[T]: ...
-
Implemented!