Skip to main content

Forge

Struct Forge 

Source
pub struct Forge<R: ProcessRunner = JobRunner> { /* private fields */ }
Expand description

A cwd-bound, forge-agnostic handle. Operations run against the bound directory (cwd); the CLI infers the repository from that directory’s git remote. Use at for a sibling handle bound elsewhere.

Implementations§

Source§

impl Forge<JobRunner>

Source

pub fn github(cwd: impl Into<PathBuf>) -> Self

A GitHub-backed handle bound to cwd, using the real job-backed runner.

Source

pub fn gitlab(cwd: impl Into<PathBuf>) -> Self

A GitLab-backed handle bound to cwd, using the real job-backed runner.

Source

pub fn gitea(cwd: impl Into<PathBuf>) -> Self

A Gitea-backed handle bound to cwd, using the real job-backed runner.

Source§

impl<R: ProcessRunner> Forge<R>

Source

pub fn for_github(cwd: impl Into<PathBuf>, client: GitHub<R>) -> Self

Build a GitHub-backed handle from an explicit client — for a custom runner (e.g. a test seam) or a pre-configured GitHub.

Source

pub fn for_gitlab(cwd: impl Into<PathBuf>, client: GitLab<R>) -> Self

Build a GitLab-backed handle from an explicit GitLab client.

Source

pub fn for_gitea(cwd: impl Into<PathBuf>, client: Gitea<R>) -> Self

Build a Gitea-backed handle from an explicit Gitea client.

Source

pub fn kind(&self) -> ForgeKind

Which forge drives this handle.

Source

pub fn cwd(&self) -> &Path

The directory operations run against.

Source

pub fn at(&self, dir: impl Into<PathBuf>) -> Self

A sibling handle bound to dir, sharing this handle’s client.

Source

pub async fn auth_status(&self) -> Result<bool>

Whether the user is authenticated (GitHub/GitLab: a zero-exit auth status; Gitea: at least one configured login).

Source

pub async fn repo_view(&self) -> Result<ForgeRepo>

The repository/project for the bound directory. Unsupported on Gitea (tea has no current-repo view).

Source

pub async fn pr_list(&self) -> Result<Vec<ForgePr>>

Open pull/merge requests for the bound directory.

Source

pub async fn pr_view(&self, number: u64) -> Result<ForgePr>

A single PR/MR by number (GitLab iid). On Gitea this lists and filters (tea has no single-PR view).

Source

pub async fn pr_create(&self, spec: PrCreate) -> Result<String>

Open a PR/MR (see PrCreate), returning the CLI’s success output — a URL on GitHub/GitLab; tea prints a textual summary (no URL).

Source

pub async fn pr_merge(&self, number: u64, strategy: MergeStrategy) -> Result<()>

Merge a PR/MR with the given MergeStrategy.

Source

pub async fn pr_mark_ready(&self, number: u64) -> Result<()>

Mark a draft PR/MR as ready for review. Unsupported on Gitea (tea has no draft toggle — a Gitea draft is a WIP: title prefix, edited via the raw client).

Source

pub async fn pr_close(&self, number: u64, delete_branch: bool) -> Result<()>

Close a PR/MR without merging. delete_branch applies to GitHub only (gh pr close --delete-branch); GitLab and Gitea ignore it.

Source

pub async fn pr_checks(&self, number: u64) -> Result<CiStatus>

The PR/MR’s coarse CI status (see CiStatus). Unsupported on Gitea (tea has no checks command).

Source

pub async fn issue_list(&self) -> Result<Vec<ForgeIssue>>

Open issues for the bound directory (up to 100; drop to the underlying client for more).

Source

pub async fn issue_view(&self, number: u64) -> Result<ForgeIssue>

A single issue by number (GitLab iid), with body/url filled.

Source

pub async fn issue_create(&self, title: &str, body: &str) -> Result<String>

Open an issue, returning the CLI’s success output — a URL on GitHub/GitLab; tea prints a textual summary whose final line is the URL. (The same honest-output contract as pr_create.)

Source

pub async fn release_list(&self) -> Result<Vec<ForgeRelease>>

Releases for the bound directory, newest first (up to 100; drop to the underlying client for more).

Source

pub async fn release_view(&self, tag: &str) -> Result<ForgeRelease>

A single release by tag. Unsupported on Gitea (tea releases always lists — it has no single-release view; filter release_list instead).

Trait Implementations§

Source§

impl<R: ProcessRunner> ForgeApi for Forge<R>

Source§

fn kind(&self) -> ForgeKind

Which forge drives this handle.
Source§

fn cwd(&self) -> &Path

The directory operations run against.
Source§

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

Source§

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

Source§

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

Source§

fn pr_view<'life0, 'async_trait>( &'life0 self, number: u64, ) -> Pin<Box<dyn Future<Output = Result<ForgePr>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn pr_create<'life0, 'async_trait>( &'life0 self, spec: PrCreate, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn pr_merge<'life0, 'async_trait>( &'life0 self, number: u64, strategy: MergeStrategy, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

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

Source§

fn pr_close<'life0, 'async_trait>( &'life0 self, number: u64, delete_branch: bool, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn pr_checks<'life0, 'async_trait>( &'life0 self, number: u64, ) -> Pin<Box<dyn Future<Output = Result<CiStatus>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

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

Source§

fn issue_view<'life0, 'async_trait>( &'life0 self, number: u64, ) -> Pin<Box<dyn Future<Output = Result<ForgeIssue>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn issue_create<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, title: &'life1 str, body: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

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

Source§

fn release_view<'life0, 'life1, 'async_trait>( &'life0 self, tag: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<ForgeRelease>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Auto Trait Implementations§

§

impl<R> Freeze for Forge<R>

§

impl<R> RefUnwindSafe for Forge<R>
where R: RefUnwindSafe,

§

impl<R> Send for Forge<R>

§

impl<R> Sync for Forge<R>

§

impl<R> Unpin for Forge<R>

§

impl<R> UnsafeUnpin for Forge<R>

§

impl<R> UnwindSafe for Forge<R>
where R: RefUnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more