pub struct Scene {
pub scratch: Scratch,
/* private fields */
}Fields§
§scratch: ScratchImplementations§
Source§impl Scene
impl Scene
pub fn id(&self, live: Live) -> u32
Sourcepub fn stdin(&mut self, live: Live) -> Option<&mut ChildStdin>
pub fn stdin(&mut self, live: Live) -> Option<&mut ChildStdin>
The child’s piped stdin, to write to. The scene hands out only stdio
handles, never the Child: observing, killing and reaping go through
the scene, so no test can reap a root whose group cleanup then kills.
Sourcepub fn take_stdin(&mut self, live: Live) -> Option<ChildStdin>
pub fn take_stdin(&mut self, live: Live) -> Option<ChildStdin>
Take the piped stdin (dropping it closes the child’s stdin).
Sourcepub fn take_stdout(&mut self, live: Live) -> Option<ChildStdout>
pub fn take_stdout(&mut self, live: Live) -> Option<ChildStdout>
Take the piped stdout, for drain.
Sourcepub fn take_stderr(&mut self, live: Live) -> Option<ChildStderr>
pub fn take_stderr(&mut self, live: Live) -> Option<ChildStderr>
Take the piped stderr, for drain.
Sourcepub fn adopt(&mut self, pid: u32, service: bool) -> Result<Live>
pub fn adopt(&mut self, pid: u32, service: bool) -> Result<Live>
Adopt a descendant re-parented to this process (a Linux subreaper’s orphan): the scene observes, reaps and on cleanup kills it as one of its own, so its outside SIGKILL is the scene’s retry case. Its group is never signalled, since it may be this process’s own.
§Errors
ECHILD when pid is not (yet) this process’s child.
Sourcepub fn running(&mut self, live: Live) -> Result<bool>
pub fn running(&mut self, live: Live) -> Result<bool>
Observe/reap through the scene so descendants are killed before the root pid can be recycled.
Sourcepub fn mark(&mut self, path: &Path, watched: &[Live]) -> Result<()>
pub fn mark(&mut self, path: &Path, watched: &[Live]) -> Result<()>
Wait for a filesystem mark (a file another process creates) while
watching watched. One that ends first returns BrokenPipe at once,
so an outside SIGKILL reaches scene arbitration, not the guard.
§Panics
When the mark outlasts the testkit deadlock guard.