Skip to main content

Scene

Struct Scene 

Source
pub struct Scene {
    pub scratch: Scratch,
    /* private fields */
}

Fields§

§scratch: Scratch

Implementations§

Source§

impl Scene

Source

pub fn id(&self, live: Live) -> u32

Source

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.

Source

pub fn take_stdin(&mut self, live: Live) -> Option<ChildStdin>

Take the piped stdin (dropping it closes the child’s stdin).

Source

pub fn take_stdout(&mut self, live: Live) -> Option<ChildStdout>

Take the piped stdout, for drain.

Source

pub fn take_stderr(&mut self, live: Live) -> Option<ChildStderr>

Take the piped stderr, for drain.

Source

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.

Source

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.

Source

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.

Source

pub fn signal(&mut self, live: Live, signal: i32) -> Result<()>

Source

pub fn kill(&mut self, live: Live) -> Result<()>

A test’s deliberate SIGKILL never counts as an outside kill.

Source

pub fn wait(&mut self, live: Live) -> Result<ExitStatus>

§Panics

When the child outlasts the testkit deadlock guard.

Trait Implementations§

Source§

impl Drop for Scene

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl Forget for Scene

§

impl Freeze for Scene

§

impl Move for Scene

§

impl RefUnwindSafe for Scene

§

impl Send for Scene

§

impl Sync for Scene

§

impl Unpin for Scene

§

impl UnsafeUnpin for Scene

§

impl UnwindSafe for Scene

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<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, 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.