Skip to main content

TaskSource

Trait TaskSource 

Source
pub trait TaskSource: Send + Sync {
Show 29 methods // Required methods fn kind(&self) -> &'static str; fn capabilities(&self) -> Capabilities; fn health<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Health, SourceError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_task<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 NativeId, ) -> Pin<Box<dyn Future<Output = Result<Option<Task>, SourceError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_project<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 NativeId, ) -> Pin<Box<dyn Future<Output = Result<Option<Project>, SourceError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn query_tasks<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, query: &'life1 TaskQuery, page: &'life2 PageRequest, ) -> Pin<Box<dyn Future<Output = Result<Page<Task>, SourceError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn query_projects<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, query: &'life1 ProjectQuery, page: &'life2 PageRequest, ) -> Pin<Box<dyn Future<Output = Result<Page<Project>, SourceError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn labels<'life0, 'life1, 'async_trait>( &'life0 self, page: &'life1 PageRequest, ) -> Pin<Box<dyn Future<Output = Result<Page<Label>, SourceError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn task_dependencies<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, id: &'life1 NativeId, direction: Direction, page: &'life2 PageRequest, ) -> Pin<Box<dyn Future<Output = Result<Page<DependencyEdge>, SourceError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn project_dependencies<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, id: &'life1 NativeId, direction: Direction, page: &'life2 PageRequest, ) -> Pin<Box<dyn Future<Output = Result<Page<DependencyEdge>, SourceError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; // Provided methods fn writes(&self) -> WriteSupport { ... } fn write_task<'life0, 'life1, 'async_trait>( &'life0 self, write: &'life1 ItemWrite<Task>, ) -> Pin<Box<dyn Future<Output = Result<NativeId, SourceError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn write_project<'life0, 'life1, 'async_trait>( &'life0 self, write: &'life1 ItemWrite<Project>, ) -> Pin<Box<dyn Future<Output = Result<NativeId, SourceError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn set_task_status<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 NativeId, category: StatusCategory, ) -> Pin<Box<dyn Future<Output = Result<Option<Status>, SourceError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn set_delivered_by<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, id: &'life1 NativeId, delivered_by: &'life2 [TaskRef], ) -> Pin<Box<dyn Future<Output = Result<Option<()>, SourceError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn set_task_metadata<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, id: &'life1 NativeId, key: &'life2 MetadataKey, value: &'life3 Value, ) -> Pin<Box<dyn Future<Output = Result<Option<Task>, SourceError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait { ... } fn set_project_metadata<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, id: &'life1 NativeId, key: &'life2 MetadataKey, value: &'life3 Value, ) -> Pin<Box<dyn Future<Output = Result<Option<Project>, SourceError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait { ... } fn set_document_metadata<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, id: &'life1 NativeId, key: &'life2 MetadataKey, value: &'life3 Value, ) -> Pin<Box<dyn Future<Output = Result<Option<Document>, SourceError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait { ... } fn delete_task<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 NativeId, ) -> Pin<Box<dyn Future<Output = Result<(), SourceError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn delete_project<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 NativeId, ) -> Pin<Box<dyn Future<Output = Result<(), SourceError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn get_document<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 NativeId, ) -> Pin<Box<dyn Future<Output = Result<Option<Document>, SourceError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn query_documents<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, query: &'life1 DocumentQuery, page: &'life2 PageRequest, ) -> Pin<Box<dyn Future<Output = Result<Page<Document>, SourceError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn write_document<'life0, 'life1, 'async_trait>( &'life0 self, write: &'life1 ItemWrite<Document>, ) -> Pin<Box<dyn Future<Output = Result<NativeId, SourceError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn delete_document<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 NativeId, ) -> Pin<Box<dyn Future<Output = Result<(), SourceError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn task_comments<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, task: &'life1 NativeId, page: &'life2 PageRequest, ) -> Pin<Box<dyn Future<Output = Result<Option<Page<Comment>>, SourceError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn add_comment<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, task: &'life1 NativeId, comment: &'life2 NewComment, ) -> Pin<Box<dyn Future<Output = Result<Option<Comment>, SourceError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn edit_comment<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, task: &'life1 NativeId, comment: &'life2 NativeId, body: &'life3 CommentBody, ) -> Pin<Box<dyn Future<Output = Result<Option<Comment>, SourceError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait { ... } fn delete_comment<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, task: &'life1 NativeId, comment: &'life2 NativeId, ) -> Pin<Box<dyn Future<Output = Result<Option<NativeId>, SourceError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn metering<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<Metering>, SourceError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... }
}
Expand description

One configured source, as the engine drives it.

Dyn-compatible through async_trait because the engine holds Vec<Box<dyn TaskSource>> over heterogeneous plugins.

Three rules bind every implementation, and the engine’s compensation is only correct while all three hold:

  1. Apply every predicate you declare Support::Native.
  2. Ignore every Support-typed predicate you declare Unsupported — return the wider result set, never a narrower one. Silently dropping rows for a predicate you did not declare is the one failure no test above the plugin can catch.
  3. Never return a silently empty dependency read. Rule 2 reaches the Support-typed predicates alone; a dependency read is always real, and so is a document read — Capabilities::documents says whether this source has documents at all, and a source that says it has none is never asked for one rather than answering an empty page.

Required Methods§

Source

fn kind(&self) -> &'static str

The plugin kind that built this source, for display and for plan output.

Source

fn capabilities(&self) -> Capabilities

What this source applies itself. Read once per query by the engine.

Source

fn health<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Health, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Whether the source is answering right now.

§Errors

Returns a SourceError when the check itself could not be made.

Source

fn get_task<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 NativeId, ) -> Pin<Box<dyn Future<Output = Result<Option<Task>, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch one task by its native id, or None when there is no such task.

§Errors

Returns a SourceError when the source could not answer.

Source

fn get_project<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 NativeId, ) -> Pin<Box<dyn Future<Output = Result<Option<Project>, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch one project by its native id, or None when there is no such project.

§Errors

Returns a SourceError when the source could not answer.

Source

fn query_tasks<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, query: &'life1 TaskQuery, page: &'life2 PageRequest, ) -> Pin<Box<dyn Future<Output = Result<Page<Task>, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

One page of the tasks matching query.

§Errors

Returns a SourceError when the source could not answer.

Source

fn query_projects<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, query: &'life1 ProjectQuery, page: &'life2 PageRequest, ) -> Pin<Box<dyn Future<Output = Result<Page<Project>, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

One page of the projects matching query.

§Errors

Returns a SourceError when the source could not answer.

Source

fn labels<'life0, 'life1, 'async_trait>( &'life0 self, page: &'life1 PageRequest, ) -> Pin<Box<dyn Future<Output = Result<Page<Label>, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

One page of every label this source knows.

§Errors

Returns a SourceError when the source could not answer.

Source

fn task_dependencies<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, id: &'life1 NativeId, direction: Direction, page: &'life2 PageRequest, ) -> Pin<Box<dyn Future<Output = Result<Page<DependencyEdge>, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

One page of the task dependency edges at id, in direction.

§Errors

Returns a SourceError when the source could not answer.

Source

fn project_dependencies<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, id: &'life1 NativeId, direction: Direction, page: &'life2 PageRequest, ) -> Pin<Box<dyn Future<Output = Result<Page<DependencyEdge>, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

One page of the project dependency edges at id, in direction.

§Errors

Returns a SourceError when the source could not answer.

Provided Methods§

Source

fn writes(&self) -> WriteSupport

Whether this source can be written through at all.

Defaulted to WriteSupport::Unsupported, which is what keeps this a read interface for every source that has nothing to write into: one that cannot be written needs no edit and keeps working. Read before a write is attempted, so a copy naming such a source as its destination is refused before anything is read.

Source

fn write_task<'life0, 'life1, 'async_trait>( &'life0 self, write: &'life1 ItemWrite<Task>, ) -> Pin<Box<dyn Future<Output = Result<NativeId, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Create or update one task, answering with the native id the destination holds it under.

A source declaring WriteSupport::Supported owes three things here. It refuses, naming the field, anything it cannot represent rather than dropping it — including a metadata key it cannot carry, which it names. It writes every other field it was given. And it never creates when ItemWrite::target names an item it does not hold.

§Errors

Returns SourceError::Refused when this source has no write side, when a field or a metadata key cannot be represented, or when target names nothing here; and whatever else the source could not do the write for.

Source

fn write_project<'life0, 'life1, 'async_trait>( &'life0 self, write: &'life1 ItemWrite<Project>, ) -> Pin<Box<dyn Future<Output = Result<NativeId, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Create or update one project, on exactly the terms of write_task.

§Errors

As write_task.

Source

fn set_task_status<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 NativeId, category: StatusCategory, ) -> Pin<Box<dyn Future<Output = Result<Option<Status>, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Set the status of one task this source holds, and change nothing else about it, answering with the status as this source now reads it — or None when this source holds no such task.

The category lands where this source’s own mapping sends it, exactly as a write_task of a task in that category would: a category this source has disabled is refused in the words a write of it is refused with. Title, content, labels, metadata, dependencies, Task::delivers, Task::delivered_by, project and comments are left exactly as they are.

Defaulted to unwritable_field, which is what keeps this an addition rather than a break: a source that cannot write a status on its own needs no edit and refuses by saying so. A source declaring WriteSupport::Unsupported is never asked.

§Errors

Returns SourceError::Refused when this source cannot write a status, or cannot write this one; and whatever else the source could not do the write for.

Source

fn set_delivered_by<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, id: &'life1 NativeId, delivered_by: &'life2 [TaskRef], ) -> Pin<Box<dyn Future<Output = Result<Option<()>, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Replace the Task::delivered_by of one task this source holds, and change nothing else about it — or answer None when this source holds no such task.

Every entry is a qualified id, and the list is the whole of it: what the task held there before is replaced, not merged. It is the store’s to keep in step — the engine calls this whenever it writes a task’s Task::delivers — and nothing a person types reaches it directly.

Defaulted to unwritable_field on exactly the terms of set_task_status.

§Errors

Returns SourceError::Refused when this source cannot hold the list, and whatever else it could not do the write for.

Source

fn set_task_metadata<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, id: &'life1 NativeId, key: &'life2 MetadataKey, value: &'life3 Value, ) -> Pin<Box<dyn Future<Output = Result<Option<Task>, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Set one key of the metadata of one task this source holds, and change nothing else about it, answering with the task as this source reads it back after the write — or None when this source holds no such task.

The key is added when the task does not hold it and replaced when it does; every other metadata key, and every other field of the task, is left exactly as it was. A value the task already holds under key is a write that changes nothing, and a source owes it no write at all. The answer is a read, not an echo: what the engine reports as the value is what the returned task holds under key.

Nothing about the task’s status or its Task::delivers moves, so the engine re-evaluates no delivered task after this write.

Defaulted to unwritable_metadata on exactly the terms of set_task_status: a source that cannot write one key on its own needs no edit and refuses by saying so. A source declaring WriteSupport::Unsupported is never asked.

§Errors

Returns SourceError::Refused when this source cannot write one key of a task’s metadata on its own, or cannot write this one without changing something else; and whatever else the source could not do the write for.

Source

fn set_project_metadata<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, id: &'life1 NativeId, key: &'life2 MetadataKey, value: &'life3 Value, ) -> Pin<Box<dyn Future<Output = Result<Option<Project>, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Set one key of the metadata of one project this source holds, on exactly the terms of set_task_metadata.

§Errors

As set_task_metadata.

Source

fn set_document_metadata<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, id: &'life1 NativeId, key: &'life2 MetadataKey, value: &'life3 Value, ) -> Pin<Box<dyn Future<Output = Result<Option<Document>, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Set one key of the metadata of one document this source holds, on exactly the terms of set_task_metadata.

A source declaring Capabilities::documents unsupported is never asked, exactly as it is never asked for a document read.

§Errors

As set_task_metadata.

Source

fn delete_task<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 NativeId, ) -> Pin<Box<dyn Future<Output = Result<(), SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Remove one task this destination holds, so a copy that could not finish can put the destination back the way it found it.

This is not a verb of the product: nothing a user types deletes anything, and a copy never deletes an item it did not itself create in the run that is failing. It exists because a copy is either complete or it never happened — a half-written project has to be run again, and the re-run is the mutation burst that trips a hosted destination’s rate limiter. Undoing this run’s own creates is what removes that retry at source.

A source declaring WriteSupport::Supported owes a real implementation, for the reason it owes write_task one: the engine will create items there, so it has to be able to remove the ones it created. An id naming nothing is not an error — the item is already gone, which is the state this asks for.

§Errors

Returns SourceError::Refused when this source has no write side, and whatever else the source could not remove the item for.

Source

fn delete_project<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 NativeId, ) -> Pin<Box<dyn Future<Output = Result<(), SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Remove one project this destination holds, on exactly the terms of delete_task.

§Errors

As delete_task.

Source

fn get_document<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 NativeId, ) -> Pin<Box<dyn Future<Output = Result<Option<Document>, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch one document by its native id, or None when there is no such document.

Defaulted to documentless, which is what keeps documents an addition rather than a break: a source with none needs no edit, keeps working, and says so in the same words every other document-free source does. A source that has documents declares Support::Native for Capabilities::documents and owes a real implementation here, because that declaration is what makes the engine ask.

§Errors

Returns SourceError::Refused when this source has no documents, and whatever else the source could not answer for.

Source

fn query_documents<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, query: &'life1 DocumentQuery, page: &'life2 PageRequest, ) -> Pin<Box<dyn Future<Output = Result<Page<Document>, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

One page of the documents matching query.

Defaulted on exactly the terms of get_document. A source with no documents refuses rather than answering an empty page: an empty page reads as a source that has documents and holds none matching, which is the one wrong answer this method can give.

§Errors

As get_document.

Source

fn write_document<'life0, 'life1, 'async_trait>( &'life0 self, write: &'life1 ItemWrite<Document>, ) -> Pin<Box<dyn Future<Output = Result<NativeId, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Create or update one document, on exactly the terms of write_task.

§Errors

As write_task.

Source

fn delete_document<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 NativeId, ) -> Pin<Box<dyn Future<Output = Result<(), SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Remove one document this destination holds, on exactly the terms of delete_task.

§Errors

As delete_task.

Source

fn task_comments<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, task: &'life1 NativeId, page: &'life2 PageRequest, ) -> Pin<Box<dyn Future<Output = Result<Option<Page<Comment>>, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

One page of the comments on task, oldest first, or None when this source holds no such task.

Defaulted to commentless, which is what keeps comments an addition rather than a break: a source with none needs no edit and keeps working. A source whose tasks have comments declares Support::Native for Capabilities::comments and owes a real implementation of all four comment methods, because that declaration is what makes the engine ask.

“No such task” is None rather than an error, exactly as it is for get_task; a task that exists and has no comments is an empty page.

§Errors

Returns SourceError::Refused when this source has no comments, and whatever else the source could not answer for.

Source

fn add_comment<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, task: &'life1 NativeId, comment: &'life2 NewComment, ) -> Pin<Box<dyn Future<Output = Result<Option<Comment>, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Add one comment to task, answering with the comment as the source now holds it, or None when this source holds no such task.

The body is stored byte for byte. A source that records the author itself refuses a NewComment::author rather than dropping it, naming why; a source that cannot represent the body refuses it, naming why, rather than escaping it into something else.

§Errors

Returns SourceError::Refused when this source has no comments or cannot be written, when it cannot record what it was given, and whatever else it could not do the write for.

Source

fn edit_comment<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, task: &'life1 NativeId, comment: &'life2 NativeId, body: &'life3 CommentBody, ) -> Pin<Box<dyn Future<Output = Result<Option<Comment>, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Replace the body of the comment comment on task, answering with the comment as the source now holds it, or None when this source holds no such task or that task has no such comment.

Only the body and the time it last changed move: the id, the author and the time it was written are the comment’s own.

§Errors

As add_comment.

Source

fn delete_comment<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, task: &'life1 NativeId, comment: &'life2 NativeId, ) -> Pin<Box<dyn Future<Output = Result<Option<NativeId>, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Remove the comment comment from task, answering with the id it removed, or None when this source holds no such task or that task has no such comment.

Unlike delete_task, this is a verb of the product — a person removes a comment they posted — so a comment that is not there is reported as None for the engine to refuse by name, rather than treated as already gone.

§Errors

As add_comment.

Source

fn metering<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<Metering>, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

What this source has sent to its backend since it was built and what that spent, or None when it does not meter its own requests.

Defaulted to None, which is what keeps metering an addition rather than a break: a source that does not count its requests needs no edit, and is reported as not metering rather than as having spent nothing. A source that answers owes a running total — see Metering — because what one command spent is read as the difference between two readings.

§Errors

Returns a SourceError when the reading itself could not be taken. A caller reports such a source as not metering; what a command cost is never a reason for the command to fail.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§