Skip to main content

Forge

Trait Forge 

Source
pub trait Forge: Send + Sync {
    // Required methods
    fn kind(&self) -> ForgeKind;
    fn whoami(&self) -> Result<String, ForgeError>;
    fn request(&self, id: Option<&str>) -> Result<Request, ForgeError>;
    fn threads(&self, req: &Request) -> Result<Vec<RemoteThread>, ForgeError>;
    fn publish(&self, req: &Request, batch: &Batch) -> Result<Sent, ForgeError>;
    fn set_resolved(
        &self,
        req: &Request,
        thread: &str,
        resolved: bool,
    ) -> Result<(), ForgeError>;
    fn edit_comment(
        &self,
        req: &Request,
        thread: &str,
        comment: &str,
        body: &str,
    ) -> Result<(), ForgeError>;
    fn delete_comment(
        &self,
        req: &Request,
        thread: &str,
        comment: &str,
    ) -> Result<(), ForgeError>;
}
Expand description

The forge, as the domain needs it. dyn: which forge a repository is on is a run-time answer, like which model groups (ADR 0020, 0029).

Required Methods§

Source

fn kind(&self) -> ForgeKind

Source

fn whoami(&self) -> Result<String, ForgeError>

The login the tool is signed in as. A comment by this author is the reader’s, marker or not.

Source

fn request(&self, id: Option<&str>) -> Result<Request, ForgeError>

The request with this id, or the current branch’s when None.

Source

fn threads(&self, req: &Request) -> Result<Vec<RemoteThread>, ForgeError>

Every review thread on the request, unplaced (anchor: None).

Source

fn publish(&self, req: &Request, batch: &Batch) -> Result<Sent, ForgeError>

Send one batch. Comments against req.head; the caller has already checked that is the review’s head. Err only while nothing has left the machine; after that, Ok(Sent) with a failed.

Source

fn set_resolved( &self, req: &Request, thread: &str, resolved: bool, ) -> Result<(), ForgeError>

Source

fn edit_comment( &self, req: &Request, thread: &str, comment: &str, body: &str, ) -> Result<(), ForgeError>

Rewrite a comment this reader published. The body arrives with its marker, as it was sent.

Source

fn delete_comment( &self, req: &Request, thread: &str, comment: &str, ) -> Result<(), ForgeError>

Remove a comment this reader published.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§