pub struct TCTask { /* private fields */ }
Expand description
***** TCTask *****
A task, as publicly exposed by this library.
A task begins in “immutable” mode. It must be converted to “mutable” mode to make any changes, and doing so requires exclusive access to the replica until the task is freed or converted back to immutable mode.
An immutable task carries no reference to the replica that created it, and can be used until it is freed or converted to a TaskMut. A mutable task carries a reference to the replica and must be freed or made immutable before the replica is freed.
All tc_task_..
functions taking a task as an argument require that it not be NULL.
When a tc_task_..
function that returns a TCResult returns TC_RESULT_ERROR, then
tc_task_error
will return the error message.
§Safety
A task is an owned object, and must be freed with tc_task_free (or, if part of a list, with tc_task_list_free).
Any function taking a *TCTask
requires:
- the pointer must not be NUL;
- the pointer must be one previously returned from a tc_… function;
- the memory referenced by the pointer must never be modified by C code; and
- except for
tc_{task,task_list}_free
, ownership of a*TCTask
remains with the caller.
Once passed to tc_task_free, a *TCTask
becomes invalid and must not be used again.
TCTasks are not threadsafe.
typedef struct TCTask TCTask;
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TCTask
impl !RefUnwindSafe for TCTask
impl !Send for TCTask
impl !Sync for TCTask
impl Unpin for TCTask
impl !UnwindSafe for TCTask
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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