Struct concurrency_traits::StdThreadFunctions [−][src]
pub struct StdThreadFunctions;
Expand description
Std implementations for TimeFunctions
, ThreadFunctions], [
TryThreadSpawner], and [
ThreadParker`.
Trait Implementations
impl Clone for StdThreadFunctions
[src]
impl Clone for StdThreadFunctions
[src]fn clone(&self) -> StdThreadFunctions
[src]
fn clone(&self) -> StdThreadFunctions
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Debug for StdThreadFunctions
[src]
impl Debug for StdThreadFunctions
[src]impl ThreadFunctions for StdThreadFunctions
[src]
impl ThreadFunctions for StdThreadFunctions
[src]fn sleep(duration: Duration)
[src]
fn sleep(duration: Duration)
[src]Sleeps the current thread for a specified duration. Analog for std::thread::sleep
.
fn yield_now()
[src]
fn yield_now()
[src]Yields the current thread to the OS. Analog for std::thread::yield_now
.
impl ThreadParker for StdThreadFunctions
[src]
impl ThreadParker for StdThreadFunctions
[src]type ThreadId = Thread
type ThreadId = Thread
The type of a thread portable id. Analog for std::thread::Thread
.
fn park()
[src]
fn park()
[src]Parks the current thread. Analog for std::thread::park
. This may spuriously wake.
fn unpark(thread: Self::ThreadId)
[src]
fn unpark(thread: Self::ThreadId)
[src]Unparks a thread. Analog for std::thread::Thread::unpark
.
fn current_thread() -> Self::ThreadId
[src]
fn current_thread() -> Self::ThreadId
[src]Gets the handle to the current thread. Analog for std::thread::current
.
impl ThreadTimeoutParker for StdThreadFunctions
[src]
impl ThreadTimeoutParker for StdThreadFunctions
[src]fn park_timeout(timeout: Duration)
[src]
fn park_timeout(timeout: Duration)
[src]Parks the current thread with a timeout. Analog to std::thread::park_timeout
.
impl TimeFunctions for StdThreadFunctions
[src]
impl TimeFunctions for StdThreadFunctions
[src]type InstantType = Instant
type InstantType = Instant
The type of an instant for this system. Analog for std::time::Instant
.
fn current_time() -> Self::InstantType
[src]
fn current_time() -> Self::InstantType
[src]Get the current instant. Analog for std::time::Instant::now
.
impl<O> TryThreadSpawner<O> for StdThreadFunctions where
O: Send + 'static,
[src]
impl<O> TryThreadSpawner<O> for StdThreadFunctions where
O: Send + 'static,
[src]type ThreadHandle = JoinHandle<O>
type ThreadHandle = JoinHandle<O>
The handle that is returned from spawning. Analog to std::thread::JoinHandle
.
type SpawnError = Infallible
type SpawnError = Infallible
The error that can occur from starting the thread.
fn try_spawn(
func: impl FnOnce() -> O + 'static + Send
) -> Result<Self::ThreadHandle, Self::SpawnError>
[src]
fn try_spawn(
func: impl FnOnce() -> O + 'static + Send
) -> Result<Self::ThreadHandle, Self::SpawnError>
[src]Attempts to spawn a thread returning a result of Self::ThreadHandle
and Self::SpawnError
.
impl<O> ConcurrentSystem<O> for StdThreadFunctions where
O: Send + 'static,
[src]
O: Send + 'static,
impl Copy for StdThreadFunctions
[src]
Auto Trait Implementations
impl RefUnwindSafe for StdThreadFunctions
impl Send for StdThreadFunctions
impl Sync for StdThreadFunctions
impl Unpin for StdThreadFunctions
impl UnwindSafe for StdThreadFunctions
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T, O> ThreadSpawner<O> for T where
O: Send + 'static,
T: TryThreadSpawner<O, SpawnError = Infallible>,
[src]
impl<T, O> ThreadSpawner<O> for T where
O: Send + 'static,
T: TryThreadSpawner<O, SpawnError = Infallible>,
[src]fn spawn(func: impl FnOnce() -> O + 'static + Send) -> Self::ThreadHandle
[src]
fn spawn(func: impl FnOnce() -> O + 'static + Send) -> Self::ThreadHandle
[src]Spawns a thread returning a TryThreadSpawner::ThreadHandle
. Analog to std::thread::spawn
. Will be faster on nightly due to Result::unwrap_unchecked
.
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more