Skip to main content

Tracker

Trait Tracker 

Source
pub trait Tracker: Send + Sync {
    // Required methods
    fn capabilities(
        &self,
        item: Option<String>,
    ) -> Result<TrackerCapabilities, ProviderError>;
    fn issue(&self, item: String) -> Result<TrackerIssue, ProviderError>;
    fn replies(&self, request: ReplyPoll) -> Result<ReplyBatch, ProviderError>;
    fn post(&self, post: TrackerPost) -> Result<PostedComment, ProviderError>;
    fn update(&self, update: TrackerUpdate) -> Result<(), ProviderError>;
    fn create(&self, spec: IssueSpec) -> Result<TrackerIssue, ProviderError>;
    fn link(&self, link: TrackerLink) -> Result<(), ProviderError>;

    // Provided method
    fn pull_for_branch(
        &self,
        branch: String,
    ) -> Result<Option<String>, ProviderError> { ... }
}
Expand description

An issue tracker that is read, commented on and written to on demand.

A call the instance cannot make fails with GUATIAO_ERR_UNSUPPORTED and a message naming what it can do; an item outside the instance’s repository or project fails with GUATIAO_ERR_BAD_VALUE and a message that starts foreign item.

Required Methods§

Source

fn capabilities( &self, item: Option<String>, ) -> Result<TrackerCapabilities, ProviderError>

Returns what the instance can do; item adds the answers that depend on one issue.

Source

fn issue(&self, item: String) -> Result<TrackerIssue, ProviderError>

Reads one issue.

Source

fn replies(&self, request: ReplyPoll) -> Result<ReplyBatch, ProviderError>

Lists the comments made after request.since on the issues it names.

Source

fn post(&self, post: TrackerPost) -> Result<PostedComment, ProviderError>

Posts a comment, or edits the one post.edit names.

Source

fn update(&self, update: TrackerUpdate) -> Result<(), ProviderError>

Changes labels, workflow state or assignees.

Source

fn create(&self, spec: IssueSpec) -> Result<TrackerIssue, ProviderError>

Creates an issue and returns it, with its parent when one was attached.

Links two issues, or an issue and an address elsewhere.

Provided Methods§

Source

fn pull_for_branch( &self, branch: String, ) -> Result<Option<String>, ProviderError>

The open pull request whose head is branch in this instance’s repository, as its item ID; None when there is none or the instance has no pull requests.

Trait Implementations§

Source§

impl From<Instance<dyn Tracker>> for Box<dyn Tracker>

Source§

fn from(instance: Instance<dyn Tracker>) -> Self

Converts to this type from the input type.
Source§

impl From<Remote<dyn Tracker>> for Box<dyn Tracker>

Source§

fn from(remote: Remote<dyn Tracker>) -> Self

Converts to this type from the input type.
Source§

impl Kind for dyn Tracker

Source§

const NAME: &'static str = "ai6_tracker"

The kind’s name in a descriptor’s kinds and tables.
Source§

const FLOOR: usize

The size of [Kind::Vtable]: every slot. A table declaring less is refused; a larger one has slots appended after these.
Source§

const FLOOR_HASH: u32 = TrackerVtable::FLOOR_HASH

FNV-1a over the shape and every method’s name and normalised signature, in table order. A table carrying another number was built from a different declaration of this kind. Read more
Source§

const REQUIRED: &'static [(&'static str, usize)]

Every required slot as (method name, one past its end), so a null one is refused by name.
Source§

const OBJECT: bool = false

Whether this is an object kind (#[guatiao::kind(object)]): a handle one caller owns, with a destroy slot first and &mut self methods, never offered by a registry. See [Object]. Read more
Source§

type Vtable = TrackerVtable

The repr(C) table, which starts with a [KindHeader].
Source§

fn as_dyn(remote: &Remote<Self>) -> &Self

The trait object over a proxy. The macro writes remote, because only it knows the trait.
Source§

fn as_dyn_mut(remote: &mut Remote<Self>) -> &mut Self

The same, mutably — what an [Object] hands out.
Source§

fn boxed(remote: Remote<Self>) -> Box<Self>

The same, boxed.
Source§

fn shared(remote: Remote<Self>) -> Arc<Self> ⓘ

The same, shared.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl Tracker for Instance<dyn Tracker>

Source§

fn capabilities( &self, item: Option<String>, ) -> Result<TrackerCapabilities, ProviderError>

Source§

fn issue(&self, item: String) -> Result<TrackerIssue, ProviderError>

Source§

fn replies(&self, request: ReplyPoll) -> Result<ReplyBatch, ProviderError>

Source§

fn pull_for_branch( &self, branch: String, ) -> Result<Option<String>, ProviderError>

Source§

fn post(&self, post: TrackerPost) -> Result<PostedComment, ProviderError>

Source§

fn update(&self, update: TrackerUpdate) -> Result<(), ProviderError>

Source§

fn create(&self, spec: IssueSpec) -> Result<TrackerIssue, ProviderError>

Source§

impl Tracker for Remote<dyn Tracker>

Source§

fn capabilities( &self, item: Option<String>, ) -> Result<TrackerCapabilities, ProviderError>

Source§

fn issue(&self, item: String) -> Result<TrackerIssue, ProviderError>

Source§

fn replies(&self, request: ReplyPoll) -> Result<ReplyBatch, ProviderError>

Source§

fn pull_for_branch( &self, branch: String, ) -> Result<Option<String>, ProviderError>

Source§

fn post(&self, post: TrackerPost) -> Result<PostedComment, ProviderError>

Source§

fn update(&self, update: TrackerUpdate) -> Result<(), ProviderError>

Source§

fn create(&self, spec: IssueSpec) -> Result<TrackerIssue, ProviderError>

Implementors§