Skip to main content

Host

Trait Host 

Source
pub trait Host {
    // Required methods
    fn forge(&self) -> Forge;
    fn lacks(&mut self, feature: Feature) -> Option<String>;
    fn fetch(&mut self, lookups: Vec<Lookup>) -> Result<FetchResult, String>;
    fn threads(
        &mut self,
        target: &Target,
        extra: bool,
        bots: &[String],
    ) -> Result<Option<PrThreads>, String>;
    fn pushed_at(&mut self, pr: &PrThreads, sha: &str) -> Result<Pushed, Lookup>;
    fn files(
        &mut self,
        pr: &PrThreads,
        oid: &str,
        paths: &[String],
    ) -> Result<Vec<(String, String)>, String>;
    fn merge_base(&mut self, pr: &PrThreads) -> Result<String, String>;
    fn on_branch(&mut self, pr: &PrThreads, head: &str) -> Result<bool, String>;
    fn reply(
        &mut self,
        pr: &PrThreads,
        thread: &Thread,
        body: &str,
    ) -> Result<String, String>;
    fn set_resolved(
        &mut self,
        pr: &PrThreads,
        thread: &Thread,
        resolved: bool,
    ) -> Result<(), String>;
}

Required Methods§

Source

fn forge(&self) -> Forge

Source

fn lacks(&mut self, feature: Feature) -> Option<String>

Why the forge cannot do feature, or None when it can.

Source

fn fetch(&mut self, lookups: Vec<Lookup>) -> Result<FetchResult, String>

The PRs the lookups name, in the order named, as pr status reports them before attention codes are derived.

Source

fn threads( &mut self, target: &Target, extra: bool, bots: &[String], ) -> Result<Option<PrThreads>, String>

A PR’s review threads, and with extra its reviews and conversation comments. None when there is no such PR.

Source

fn pushed_at(&mut self, pr: &PrThreads, sha: &str) -> Result<Pushed, Lookup>

When sha (a prefix) was pushed to the PR.

Source

fn files( &mut self, pr: &PrThreads, oid: &str, paths: &[String], ) -> Result<Vec<(String, String)>, String>

Files at commit oid, as (path, text); a file that cannot be read is left out.

Source

fn merge_base(&mut self, pr: &PrThreads) -> Result<String, String>

The commit the PR’s diff is taken against.

Source

fn on_branch(&mut self, pr: &PrThreads, head: &str) -> Result<bool, String>

Whether head is on the PR’s branch, for a head this clone cannot place.

Source

fn reply( &mut self, pr: &PrThreads, thread: &Thread, body: &str, ) -> Result<String, String>

Posts body as a reply in thread, returning the reply’s URL.

Source

fn set_resolved( &mut self, pr: &PrThreads, thread: &Thread, resolved: bool, ) -> Result<(), String>

Resolves or unresolves thread.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§