Skip to main content

Concurrent

Struct Concurrent 

Source
pub struct Concurrent<S: Sigmask> { /* private fields */ }
Expand description

Decorator for systems that makes blocking I/O operations concurrency-friendly

This struct is used as a wrapper for systems for enabling concurrent execution of multiple possibly blocking I/O tasks on a single thread. The inner system is expected to implement the Read, Write, and super::Select traits with synchronous (blocking) behavior. This struct leaves Futures returned by I/O methods pending until the I/O operation is ready to avoid blocking the entire process. This allows you to start multiple I/O tasks and wait for them to complete concurrently on a single thread. This struct also provides methods for waiting for signals and waiting for a specified duration, which are represented as Futures as well. The select method of this struct consolidates blocking behavior into a single system call so that the process can resume execution as soon as any of the specified events occurs.

For system calls that do not block, such as Pipe, the wrapper directly forwards the call to the inner system without any modification.

This struct is designed to be used in an Rc to allow multiple tasks to share the same concurrent system. Some traits, such as Read and Write, are implemented for Rc<Concurrent<S>> instead of Concurrent<S> to allow the methods to return futures that capture a clone of the Rc and keep it alive until the operation is finished. This is necessary because the futures need to access the internal state of the Concurrent system without capturing a reference to the original Concurrent struct, which may not live long enough.

The following example illustrates how multiple concurrent tasks are run in a single-threaded pool:

let system = Rc::new(Concurrent::new(VirtualSystem::new()));
let system2 = system.clone();
let system3 = system.clone();
let (reader, writer) = system.pipe().unwrap();
let mut executor = futures_executor::LocalPool::new();

// We add a task that tries to read from the pipe, but nothing has been
// written to it, so the task is stalled.
let read_task = executor.spawner().spawn_local_with_handle(async move {
    let mut buffer = [0; 1];
    system.read(reader, &mut buffer).await.unwrap();
    buffer[0]
});
executor.run_until_stalled();

// Let's add a task that writes to the pipe.
executor.spawner().spawn_local(async move {
    system2.write_all(writer, &[123]).await.unwrap();
});
executor.run_until_stalled();

// The write task has written a byte to the pipe, but the read task is still
// stalled. We need to wake it up by calling `select` or `peek`.
system3.peek();

// Now the read task can proceed to the end.
let number = executor.run_until(read_task.unwrap());
assert_eq!(number, 123);

Implementations§

Source§

impl<S> Concurrent<S>
where S: Fork + Sigmask,

Source

pub fn new_child_process(&self) -> Result<ChildProcessStarter<S>>

👎Deprecated since 0.14.0:

use the Fork::run_in_child_process method instead

Creates a new child process.

Returns the ChildProcessStarter<S> returned by the inner system’s Fork::new_child_process method. This method is an inherent method of Concurrent<S> instead of an implementation of the Fork trait because the return type does not match with that of the inner system S.

Source§

impl Concurrent<RealSystem>

Source

pub fn run_real<F, T>(&self, task: F) -> T
where F: Future<Output = T>,

Runs the given task with concurrency support.

This function implements the main loop of the shell process. It runs the given task while also calling select to handle signals and other events. The task is expected to perform I/O operations using the methods of this Concurrent instance, so that it can yield when the operations would block. The function returns the output of the task when it completes.

This method supports concurrency only inside the task. Other tasks created outside the task will not be run concurrently. This method blocks the current thread until the task completes, so it should only be called in the main function of the shell process. See the run_virtual method for the VirtualSystem counterpart.

Source§

impl Concurrent<VirtualSystem>

Source

pub async fn run_virtual<F>(&self, task: F)
where F: Future<Output = ()>,

Runs the given task with concurrency support.

This function implements the main loop of the shell process. It runs the given task while also calling select to handle signals and other events. The task is expected to perform I/O operations using the methods of this Concurrent instance, so that it can yield when the operations would block. The function returns when the task completes or the process is terminated.

This is the VirtualSystem counterpart for the run_real method. To allow VirtualSystem to run multiple tasks concurrently, this method is asynchronous and returns a future that completes when the task finishes or the process is terminated.

Source§

impl<S: Sigmask> Concurrent<S>

Source

pub fn new(inner: S) -> Self

Creates a new Concurrent system that wraps the given inner system.

Trait Implementations§

Source§

impl<S> Chdir for Concurrent<S>
where S: Chdir + Sigmask,

Source§

fn chdir(&self, path: &CStr) -> Result<()>

Changes the working directory.
Source§

impl<S> Clock for Concurrent<S>
where S: Clock + Sigmask,

Source§

fn now(&self) -> Instant

Returns the current time.
Source§

impl<S: Clone + Sigmask> Clone for Concurrent<S>
where S::Sigset: Clone,

Source§

fn clone(&self) -> Concurrent<S>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<S> Close for Concurrent<S>
where S: Close + Sigmask,

Source§

fn close(&self, fd: Fd) -> Result<()>

Closes a file descriptor. Read more
Source§

impl<S: Debug + Sigmask> Debug for Concurrent<S>
where S::Sigset: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<S: Default + Sigmask> Default for Concurrent<S>
where S::Sigset: Default,

Source§

fn default() -> Concurrent<S>

Returns the “default value” for a type. Read more
Source§

impl<S> Dup for Concurrent<S>
where S: Dup + Sigmask,

Source§

fn dup(&self, from: Fd, to_min: Fd, flags: EnumSet<FdFlag>) -> Result<Fd>

Duplicates a file descriptor. Read more
Source§

fn dup2(&self, from: Fd, to: Fd) -> Result<Fd>

Duplicates a file descriptor. Read more
Source§

impl<S> Exec for Concurrent<S>
where S: Exec + Sigmask,

Source§

fn execve( &self, path: &CStr, args: &[CString], envs: &[CString], ) -> impl Future<Output = Result<Infallible>> + use<S>

Replaces the current process with an external utility. Read more
Source§

impl<S> Exit for Concurrent<S>
where S: Exit + Sigmask,

Source§

fn exit( &self, exit_status: ExitStatus, ) -> impl Future<Output = Infallible> + use<S>

Terminates the current process. Read more
Source§

impl<S> Fcntl for Concurrent<S>
where S: Fcntl + Sigmask,

Source§

fn ofd_access(&self, fd: Fd) -> Result<OfdAccess>

Returns the open file description access mode.
Source§

fn get_and_set_nonblocking(&self, fd: Fd, nonblocking: bool) -> Result<bool>

Gets and sets the non-blocking mode for the open file description. Read more
Source§

fn fcntl_getfd(&self, fd: Fd) -> Result<EnumSet<FdFlag>>

Returns the attributes for the file descriptor.
Source§

fn fcntl_setfd(&self, fd: Fd, flags: EnumSet<FdFlag>) -> Result<()>

Sets attributes for the file descriptor.
Source§

impl<S> Fstat for Concurrent<S>
where S: Fstat + Sigmask,

Source§

type Stat = <S as Fstat>::Stat

Metadata type returned by fstat and fstatat
Source§

fn fstat(&self, fd: Fd) -> Result<Self::Stat>

Retrieves metadata of a file. Read more
Source§

fn fstatat( &self, dir_fd: Fd, path: &CStr, follow_symlinks: bool, ) -> Result<Self::Stat>

Retrieves metadata of a file. Read more
Source§

fn is_directory(&self, path: &CStr) -> bool

Whether there is a directory at the specified path.
Source§

fn fd_is_pipe(&self, fd: Fd) -> bool

Tests if a file descriptor is a pipe.
Source§

impl<S> GetCwd for Concurrent<S>
where S: GetCwd + Sigmask,

Source§

fn getcwd(&self) -> Result<PathBuf>

Returns the current working directory path.
Source§

impl<S> GetPid for Concurrent<S>
where S: GetPid + Sigmask,

Source§

fn getpid(&self) -> Pid

Returns the process ID of the current process. Read more
Source§

fn getppid(&self) -> Pid

Returns the process ID of the parent process. Read more
Source§

fn getpgrp(&self) -> Pid

Returns the process group ID of the current process. Read more
Source§

fn getsid(&self, pid: Pid) -> Result<Pid>

Returns the session ID of the specified process. Read more
Source§

impl<S> GetPw for Concurrent<S>
where S: GetPw + Sigmask,

Source§

fn getpwnam_dir(&self, name: &CStr) -> Result<Option<PathBuf>>

Returns the home directory path of the given user. Read more
Source§

impl<S> GetRlimit for Concurrent<S>
where S: GetRlimit + Sigmask,

Source§

fn getrlimit(&self, resource: Resource) -> Result<LimitPair>

Returns the limits for the specified resource. Read more
Source§

impl<S> GetSigaction for Concurrent<S>
where S: GetSigaction + Sigmask,

Source§

fn get_sigaction(&self, signal: Number) -> Result<Disposition>

Gets the disposition for a signal. Read more
Source§

impl<S> GetUid for Concurrent<S>
where S: GetUid + Sigmask,

Source§

fn getuid(&self) -> Uid

Returns the real user ID of the current process.
Source§

fn geteuid(&self) -> Uid

Returns the effective user ID of the current process.
Source§

fn getgid(&self) -> Gid

Returns the real group ID of the current process.
Source§

fn getegid(&self) -> Gid

Returns the effective group ID of the current process.
Source§

impl<S> IsExecutableFile for Concurrent<S>

Source§

fn is_executable_file(&self, path: &CStr) -> bool

Whether there is an executable regular file at the specified path.
Source§

impl<S> Isatty for Concurrent<S>
where S: Isatty + Sigmask,

Source§

fn isatty(&self, fd: Fd) -> bool

Tests if a file descriptor is associated with a terminal device. Read more
Source§

impl<S> Open for Concurrent<S>
where S: Open + Sigmask,

This implementation does not (yet) support non-blocking open operations.

Source§

fn open( &self, path: &CStr, access: OfdAccess, flags: EnumSet<OpenFlag>, mode: Mode, ) -> impl Future<Output = Result<Fd>> + use<S>

Opens a file descriptor. Read more
Source§

fn open_tmpfile(&self, parent_dir: &Path) -> Result<Fd>

Opens a file descriptor associated with an anonymous temporary file. Read more
Source§

fn fdopendir(&self, fd: Fd) -> Result<impl Dir + use<S>>

Opens a directory for enumerating entries. Read more
Source§

fn opendir(&self, path: &CStr) -> Result<impl Dir + use<S>>

Opens a directory for enumerating entries. Read more
Source§

impl<S> Pipe for Concurrent<S>
where S: Pipe + Sigmask,

Source§

fn pipe(&self) -> Result<(Fd, Fd)>

Creates an unnamed pipe. Read more
Source§

impl<S> ReadAll for Concurrent<S>
where S: Fcntl + Read + Sigmask,

Source§

async fn read_all_to(&self, fd: Fd, buffer: &mut Vec<u8>) -> Result<(), Errno>

Reads from the file descriptor until EOF is reached, appending the data to the provided buffer. Read more
Source§

fn read_all(&self, fd: Fd) -> impl Future<Output = Result<Vec<u8>, Errno>>

Reads from the file descriptor until EOF is reached, returning the collected data as a Vec<u8>. Read more
Source§

impl<S> Seek for Concurrent<S>
where S: Seek + Sigmask,

Source§

fn lseek(&self, fd: Fd, position: SeekFrom) -> Result<u64>

Moves the position of the open file description. Read more
Source§

impl<S> Select for Concurrent<S>

Source§

fn peek(&self)

Peeks for any ready events without blocking. Read more
Source§

fn select(&self) -> impl Future<Output = ()> + use<'_, S>

Waits for any of the pending tasks to become ready. Read more
Source§

impl<S> SendSignal for Concurrent<S>
where S: SendSignal + Sigmask,

Source§

fn kill( &self, pid: Pid, signal: Option<Number>, ) -> impl Future<Output = Result<()>> + use<S>

Sends a signal. Read more
Source§

fn raise(&self, signal: Number) -> impl Future<Output = Result<()>> + use<S>

Sends a signal to the current process. Read more
Source§

impl<S> SetPgid for Concurrent<S>
where S: SetPgid + Sigmask,

Source§

fn setpgid(&self, pid: Pid, pgid: Pid) -> Result<()>

Modifies the process group ID of a process. Read more
Source§

impl<S> SetRlimit for Concurrent<S>
where S: SetRlimit + Sigmask,

Source§

fn setrlimit(&self, resource: Resource, limits: LimitPair) -> Result<()>

Sets the limits for the specified resource. Read more
Source§

impl<S> ShellPath for Concurrent<S>
where S: ShellPath + Sigmask,

Source§

fn shell_path(&self) -> CString

Returns the path to the shell executable. Read more
Source§

impl<S> Sigaction for Concurrent<S>
where S: Sigaction + Sigmask,

Exposes the inner system’s sigaction method.

This implementation of Sigaction simply delegates to the inner system’s sigaction method, which bypasses the internal state of Concurrent and may prevent the peek and select methods from responding to received signals without race conditions. To ensure that signal dispositions are configured in a way that allows Concurrent to respond to signals correctly, direct calls to sigaction should be avoided, and, if necessary, only used to temporarily change the signal disposition for specific operations while ensuring that the original disposition is restored afterward before a next call to peek, select, or set_disposition.

The standard way to set a signal disposition to Concurrent is to use the set_disposition method provided by the SignalSystem trait, which ensures that the signal disposition and the signal mask are updated consistently.

Source§

fn sigaction( &self, signal: Number, disposition: Disposition, ) -> Result<Disposition>

Gets and sets the disposition for a signal. Read more
Source§

impl<S> Sigmask for Concurrent<S>
where S: Sigmask,

Exposes the inner system’s sigmask method.

This implementation of Sigmask simply delegates to the inner system’s sigmask method, which bypasses the internal state of Concurrent and may prevent the peek and select methods from responding to received signals without race conditions. To ensure that the signal mask is configured in a way that allows Concurrent to respond to signals correctly, direct calls to sigmask should be avoided, and, if necessary, only used to temporarily change the signal mask for specific operations while ensuring that the original mask is restored afterward before a next call to peek, select, or set_disposition.

Source§

type Sigset = <S as Sigmask>::Sigset

The type representing a set of signals for this system Read more
Source§

fn sigmask( &self, op_and_signals: Option<(SigmaskOp, &Self::Sigset)>, old_mask: Option<&mut Self::Sigset>, ) -> impl Future<Output = Result<()>> + use<S>

Gets and/or sets the signal blocking mask. Read more
Source§

impl<S> Signals for Concurrent<S>
where S: Sigmask,

Source§

const SIGABRT: Number = S::SIGABRT

The signal number for SIGABRT
Source§

const SIGALRM: Number = S::SIGALRM

The signal number for SIGALRM
Source§

const SIGBUS: Number = S::SIGBUS

The signal number for SIGBUS
Source§

const SIGCHLD: Number = S::SIGCHLD

The signal number for SIGCHLD
Source§

const SIGCLD: Option<Number> = S::SIGCLD

The signal number for SIGCLD, if available on the system
Source§

const SIGCONT: Number = S::SIGCONT

The signal number for SIGCONT
Source§

const SIGEMT: Option<Number> = S::SIGEMT

The signal number for SIGEMT, if available on the system
Source§

const SIGFPE: Number = S::SIGFPE

The signal number for SIGFPE
Source§

const SIGHUP: Number = S::SIGHUP

The signal number for SIGHUP
Source§

const SIGILL: Number = S::SIGILL

The signal number for SIGILL
Source§

const SIGINFO: Option<Number> = S::SIGINFO

The signal number for SIGINFO, if available on the system
Source§

const SIGINT: Number = S::SIGINT

The signal number for SIGINT
Source§

const SIGIO: Option<Number> = S::SIGIO

The signal number for SIGIO, if available on the system
Source§

const SIGIOT: Number = S::SIGIOT

The signal number for SIGIOT
Source§

const SIGKILL: Number = S::SIGKILL

The signal number for SIGKILL
Source§

const SIGLOST: Option<Number> = S::SIGLOST

The signal number for SIGLOST, if available on the system
Source§

const SIGPIPE: Number = S::SIGPIPE

The signal number for SIGPIPE
Source§

const SIGPOLL: Option<Number> = S::SIGPOLL

The signal number for SIGPOLL, if available on the system
Source§

const SIGPROF: Number = S::SIGPROF

The signal number for SIGPROF
Source§

const SIGPWR: Option<Number> = S::SIGPWR

The signal number for SIGPWR, if available on the system
Source§

const SIGQUIT: Number = S::SIGQUIT

The signal number for SIGQUIT
Source§

const SIGSEGV: Number = S::SIGSEGV

The signal number for SIGSEGV
Source§

const SIGSTKFLT: Option<Number> = S::SIGSTKFLT

The signal number for SIGSTKFLT, if available on the system
Source§

const SIGSTOP: Number = S::SIGSTOP

The signal number for SIGSTOP
Source§

const SIGSYS: Number = S::SIGSYS

The signal number for SIGSYS
Source§

const SIGTERM: Number = S::SIGTERM

The signal number for SIGTERM
Source§

const SIGTHR: Option<Number> = S::SIGTHR

The signal number for SIGTHR, if available on the system
Source§

const SIGTRAP: Number = S::SIGTRAP

The signal number for SIGTRAP
Source§

const SIGTSTP: Number = S::SIGTSTP

The signal number for SIGTSTP
Source§

const SIGTTIN: Number = S::SIGTTIN

The signal number for SIGTTIN
Source§

const SIGTTOU: Number = S::SIGTTOU

The signal number for SIGTTOU
Source§

const SIGURG: Number = S::SIGURG

The signal number for SIGURG
Source§

const SIGUSR1: Number = S::SIGUSR1

The signal number for SIGUSR1
Source§

const SIGUSR2: Number = S::SIGUSR2

The signal number for SIGUSR2
Source§

const SIGVTALRM: Number = S::SIGVTALRM

The signal number for SIGVTALRM
Source§

const SIGWINCH: Number = S::SIGWINCH

The signal number for SIGWINCH
Source§

const SIGXCPU: Number = S::SIGXCPU

The signal number for SIGXCPU
Source§

const SIGXFSZ: Number = S::SIGXFSZ

The signal number for SIGXFSZ
Source§

const NAMED_SIGNALS: &'static [(&'static str, Option<Number>)] = S::NAMED_SIGNALS

List of all signal names and their numbers, excluding real-time signals Read more
Source§

fn sigrt_range(&self) -> Option<RangeInclusive<Number>>

Returns the range of real-time signals supported by the system. Read more
Source§

fn iter_sigrt(&self) -> impl DoubleEndedIterator<Item = Number> + use<S>

Returns an iterator over all real-time signals supported by the system. Read more
Source§

fn to_signal_number<N: Into<RawNumber>>(&self, number: N) -> Option<Number>

Tests if a signal number is valid and returns its signal number. Read more
Source§

fn sig2str<N: Into<RawNumber>>(&self, signal: N) -> Option<Cow<'static, str>>

Converts a signal number to its string representation. Read more
Source§

fn str2sig(&self, name: &str) -> Option<Number>

Converts a string representation of a signal to its signal number. Read more
Source§

fn validate_signal(&self, number: RawNumber) -> Option<(Name, Number)>

Tests if a signal number is valid and returns its name and number. Read more
Source§

fn signal_name_from_number(&self, number: Number) -> Name

Returns the signal name for the signal number. Read more
Source§

fn signal_number_from_name(&self, name: Name) -> Option<Number>

Gets the signal number from the signal name. Read more
Source§

impl<S> Sleep for Concurrent<S>
where S: Clock + Sigmask,

Source§

async fn sleep_until(&self, deadline: Instant)

Waits until the specified deadline. Read more
Source§

async fn sleep(&self, duration: Duration)

Waits for the specified duration to elapse. Read more
Source§

impl<S> Sysconf for Concurrent<S>
where S: Sysconf + Sigmask,

Source§

fn confstr_path(&self) -> Result<UnixString>

Returns the standard $PATH value where all standard utilities are expected to be found. Read more
Source§

impl<S> TcGetPgrp for Concurrent<S>
where S: Sigmask + TcGetPgrp,

Source§

fn tcgetpgrp(&self, fd: Fd) -> Result<Pid>

Returns the current foreground process group ID. Read more
Source§

impl<S> TcSetPgrp for Concurrent<S>
where S: Sigmask + TcSetPgrp,

Source§

fn tcsetpgrp( &self, fd: Fd, pgid: Pid, ) -> impl Future<Output = Result<()>> + use<S>

Switches the foreground process group. Read more
Source§

impl<S> Times for Concurrent<S>
where S: Sigmask + Times,

Source§

fn times(&self) -> Result<CpuTimes>

Returns the consumed CPU time statistics. Read more
Source§

impl<S> Umask for Concurrent<S>
where S: Sigmask + Umask,

Source§

fn umask(&self, new_mask: Mode) -> Mode

Gets and sets the file creation mode mask. Read more
Source§

impl<S> Wait for Concurrent<S>
where S: Sigmask + Wait,

Source§

fn wait(&self, target: Pid) -> Result<Option<(Pid, ProcessState)>>

Reports updated status of a child process. Read more
Source§

impl<S: Sigmask> WaitForSignals for Concurrent<S>

Source§

async fn wait_for_signals(&self) -> Rc<SignalList>

Waits for signals to be caught. Read more
Source§

impl<S> WriteAll for Concurrent<S>
where S: Fcntl + Sigmask + Write,

Source§

async fn write_all(&self, fd: Fd, data: &[u8]) -> Result<(), Errno>

Writes all data from the provided buffer to the file descriptor. Read more
Source§

fn print_error<T: AsRef<[u8]>>(&self, message: T) -> impl Future<Output = ()>

Writes the given message to standard error. Read more

Auto Trait Implementations§

§

impl<S> !Freeze for Concurrent<S>

§

impl<S> !RefUnwindSafe for Concurrent<S>

§

impl<S> !Send for Concurrent<S>

§

impl<S> !Sync for Concurrent<S>

§

impl<S> Unpin for Concurrent<S>
where S: Unpin, <S as Sigmask>::Sigset: Unpin,

§

impl<S> UnsafeUnpin for Concurrent<S>

§

impl<S> !UnwindSafe for Concurrent<S>

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<S> BlockSignals for S
where S: Sigmask + ?Sized,

Source§

type SavedMask = <S as Sigmask>::Sigset

Source§

async fn block_sigint_sigquit( &self, ) -> Result<<S as BlockSignals>::SavedMask, Errno>

Blocks SIGINT and SIGQUIT, returning the previous signal mask. Read more
Source§

async fn restore_sigmask( &self, mask: <S as BlockSignals>::SavedMask, ) -> Result<(), Errno>

Restores the signal mask. 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<S> RunBlocking for S
where S: Sigmask + ?Sized,

Source§

async fn run_blocking<F, T>(&self, signal: Number, f: F) -> Result<T, Errno>
where F: AsyncFnOnce() -> Result<T, Errno>,

Runs the given function with the specified signal blocked. Read more
Source§

impl<S> RunUnblocking for S
where S: Sigmask + Sigaction + ?Sized,

Source§

async fn run_unblocking<F, T>(&self, signal: Number, f: F) -> Result<T, Errno>
where F: AsyncFnOnce() -> Result<T, Errno>,

Runs the given function with the specified signal unblocked and the default disposition. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.