pub struct Task {
pub state: Arc<AtomicU128>,
}Fields§
§state: Arc<AtomicU128>Implementations§
Source§impl Task
impl Task
pub fn get(&self) -> Range<u64>
pub fn start(&self) -> u64
Sourcepub fn safe_add_start(
&self,
start: u64,
bias: u64,
) -> Result<Range<u64>, RangeError>
pub fn safe_add_start( &self, start: u64, bias: u64, ) -> Result<Range<u64>, RangeError>
§Errors
Returns RangeError when start + bias <= old_start
Otherwise returns old_start..new_start.min(end)
pub fn end(&self) -> u64
pub fn remain(&self) -> u64
Sourcepub fn split_two(&self) -> Result<Option<Range<u64>>, RangeError>
pub fn split_two(&self) -> Result<Option<Range<u64>>, RangeError>
§Errors
- Returns
RangeErrorwhenstart > end - Returns
Nonewhenremain < 2without modifying itself
pub fn take(&self) -> Option<Range<u64>>
pub fn downgrade(&self) -> WeakTask
pub fn strong_count(&self) -> usize
pub fn weak_count(&self) -> usize
Trait Implementations§
impl Eq for Task
Auto Trait Implementations§
impl Freeze for Task
impl RefUnwindSafe for Task
impl Send for Task
impl Sync for Task
impl Unpin for Task
impl UnsafeUnpin for Task
impl UnwindSafe for Task
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