pub enum Fork {
Parent(pid_t),
Child,
}Expand description
Fork result
Variants§
Implementations§
Source§impl Fork
impl Fork
Sourcepub const fn is_parent(&self) -> bool
pub const fn is_parent(&self) -> bool
Returns true if this is the parent process
§Examples
use fork::{fork, Fork};
match fork() {
Ok(result) => {
if result.is_parent() {
println!("I'm the parent");
}
}
Err(_) => {}
}Trait Implementations§
impl Copy for Fork
impl Eq for Fork
impl StructuralPartialEq for Fork
Auto Trait Implementations§
impl Freeze for Fork
impl RefUnwindSafe for Fork
impl Send for Fork
impl Sync for Fork
impl Unpin for Fork
impl UnwindSafe for Fork
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