[−][src]Struct oqueue::Task
Unit of work arranged by a Sequencer.
Use the standard library write! or writeln! macros for writing the
output of a task. Additionally this type provides some methods for setting
the color of task output.
Refer to the crate-level documentation and the documentation of the Sequencer type for the recommended patterns of launching tasks.
use oqueue::{Color::Blue, Task}; fn work(task: Task) { task.color(Blue); writeln!(task, "hello from task #{}", task.index); }
Fields
index: usizeIndex of the current task. This is a sequential counter that begins at 0 and increments by 1 for each successively started task. It may be helpful in determining what work this task is responsible for performing.
This field is read-only; writing to its value will not compile.
Methods
impl Task[src]
pub fn bold(&self)[src]
Set output to appear in bold uncolored.
pub fn color(&self, color: Color)[src]
Set output to appear in color (not bold).
pub fn bold_color(&self, color: Color)[src]
Set output to appear bold and colored.
pub fn reset_color(&self)[src]
Set output to non-bold uncolored.
Trait Implementations
impl Clone for Task[src]
ⓘImportant traits for Taskfn clone(&self) -> Task[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl Debug for Task[src]
impl Write for Task[src]
fn write(&mut self, b: &[u8]) -> Result<usize>[src]
fn flush(&mut self) -> Result<()>[src]
fn write_all(&mut self, buf: &[u8]) -> Result<()>[src]
fn write_fmt(&mut self, args: Arguments) -> Result<()>[src]
fn write_vectored(&mut self, bufs: &[IoVec]) -> Result<usize, Error>[src]
iovec)Like write, except that it writes from a slice of buffers. Read more
fn by_ref(&mut self) -> &mut Self1.0.0[src]
Creates a "by reference" adaptor for this instance of Write. Read more
impl WriteColor for Task[src]
fn supports_color(&self) -> bool[src]
fn set_color(&mut self, spec: &ColorSpec) -> Result<()>[src]
fn reset(&mut self) -> Result<()>[src]
fn is_synchronous(&self) -> bool[src]
Returns true if and only if the underlying writer must synchronously interact with an end user's device in order to control colors. By default, this always returns false. Read more
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>, [src]
U: From<T>,
impl<T> From for T[src]
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T> Borrow for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,