pub struct TileFiles { /* private fields */ }Expand description
The ledger of tile files for one run, shared by every backend the run makes. Clones are the same ledger; the last one dropped clears what the terminal left.
Implementations§
Source§impl TileFiles
impl TileFiles
Sourcepub fn for_terminal(var: impl Fn(&str) -> Option<String>) -> Option<Self>
pub fn for_terminal(var: impl Fn(&str) -> Option<String>) -> Option<Self>
A ledger where allowed says files may go, in the user’s own temp folder. Nothing is
written until the probe.
Sourcepub fn question(&self, id: u32) -> Option<String>
pub fn question(&self, id: u32) -> Option<String>
The question that asks whether the terminal takes a file, with id for its answer:
a 1 by 1 picture in a file of its own, queried rather than kept. None if the file
couldn’t be written, and then files are off.
Sourcepub fn answered(&self, ok: bool) -> bool
pub fn answered(&self, ok: bool) -> bool
What the terminal answered: whether it said OK. Files are on from now if it did and the file is gone, as Ghostty deletes one it has read; off for the run otherwise.
Sourcepub fn write(&self, pixels: &[u8]) -> Option<PathBuf>
pub fn write(&self, pixels: &[u8]) -> Option<PathBuf>
Writes a tile’s pixels to a file of their own, whole and closed, and gives its path for
the terminal to read. None sends the tile inline: files are off, a cap is reached, or
the write failed, which turns files off for good.