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§
fn kind(&self) -> ForgeKind
Sourcefn whoami(&self) -> Result<String, ForgeError>
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.
Sourcefn request(&self, id: Option<&str>) -> Result<Request, ForgeError>
fn request(&self, id: Option<&str>) -> Result<Request, ForgeError>
The request with this id, or the current branch’s when None.
Sourcefn threads(&self, req: &Request) -> Result<Vec<RemoteThread>, ForgeError>
fn threads(&self, req: &Request) -> Result<Vec<RemoteThread>, ForgeError>
Every review thread on the request, unplaced (anchor: None).
Sourcefn publish(&self, req: &Request, batch: &Batch) -> Result<Sent, ForgeError>
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.
fn set_resolved( &self, req: &Request, thread: &str, resolved: bool, ) -> Result<(), ForgeError>
Sourcefn edit_comment(
&self,
req: &Request,
thread: &str,
comment: &str,
body: &str,
) -> Result<(), ForgeError>
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.
Sourcefn delete_comment(
&self,
req: &Request,
thread: &str,
comment: &str,
) -> Result<(), ForgeError>
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".