Struct scoped_task::Scoped
source · pub struct Scoped<T: Task = Process>(/* private fields */);
Expand description
Scoped wrapper for a process or job backed by a Zircon handle.
The process or job is killed when the wrapper goes out of scope or the current process panics. See the module-level documentation for more details.
Implementations§
source§impl<T: Task> Scoped<T>
impl<T: Task> Scoped<T>
sourcepub fn kill(self) -> Result<T, Status>
pub fn kill(self) -> Result<T, Status>
Kills the process, consuming the Scoped wrapper and returning the inner task object.
sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consumes the Scoped wrapper and returns the inner task object. The task will no longer be killed on Drop, but may still be killed on exit.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Scoped<T>where
T: Freeze,
impl<T> RefUnwindSafe for Scoped<T>where
T: RefUnwindSafe,
impl<T> Send for Scoped<T>where
T: Send,
impl<T> Sync for Scoped<T>where
T: Sync,
impl<T> Unpin for Scoped<T>where
T: Unpin,
impl<T> UnwindSafe for Scoped<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more