Skip to main content

Client

Struct Client 

Source
pub struct Client { /* private fields */ }
Expand description

A forge CLI bound to one project.

Implementations§

Source§

impl Client

Source

pub fn resolve( forge: Forge, target: &Utf8Path, repo: &str, ) -> Result<Self, RkError>

The client for forge, run from target, for project repo.

§Errors

The resolution’s refusal, which names the client, where no usable binary resolves.

Source

pub const fn forge(&self) -> Forge

The forge.

Source

pub fn api(&self, method: &str, path: &str, body: Option<&Value>) -> Api

One api call, with a JSON body where one is given.

Source

pub fn open_request( &self, base: &str, branch: &str, ) -> Result<Option<u64>, RkError>

The open request whose head is branch against base, by number.

§Errors

A refusal where the forge does not answer.

Source

pub fn merges_request( &self, sha: &str, base: &str, branch: &str, ) -> Result<bool, RkError>

Whether sha is the merge or squash commit of a merged request whose head is branch and whose base is base.

SATISFIES release-engine:a-final-version-releases-at-its-request

§Errors

A refusal where the forge does not answer.

Source

pub fn release(&self, tag: &str) -> Result<Option<Release>, RkError>

The release of tag, a draft included, where one exists.

§Errors

A refusal where the forge does not answer.

Source

pub fn tag(&self, tag: &str) -> TagAt

The commit tag names, in three states: present, absent, and a read that failed.

Source

pub fn package_files(&self, version: &str) -> Result<Vec<Asset>, RkError>

Every file the GitLab generic package release holds at version, with its SHA-256.

§Errors

A refusal where the forge does not answer.

Source

pub fn identity(&self) -> Result<(String, String), RkError>

The name and the email of the account the client’s credential names.

SATISFIES bot-identity:the-bot-identity-reaches-one-project

GitHub answers the App’s bot account as the viewer of its installation token, and its email is the account’s noreply address. GitLab answers the token’s user, and a user with no public email takes its username’s noreply address on the instance.

§Errors

A refusal where the forge does not answer.

Source

pub fn create_request( &self, base: &str, branch: &str, title: &str, body: &str, ) -> Result<u64, RkError>

Open the request from branch into base.

§Errors

The forge’s refusal.

Source

pub fn edit_request( &self, number: u64, title: &str, body: &str, ) -> Result<(), RkError>

Edit the request’s title and description in place.

§Errors

The forge’s refusal.

Source

pub fn close_request(&self, number: u64) -> Result<(), RkError>

Close a request that has nothing left to release.

§Errors

The forge’s refusal.

Source

pub fn arm(&self, number: u64, form: MergeForm) -> Result<bool, RkError>

Arm the request to merge itself once its checks pass. On GitLab an arm the forge cannot take yet, before the request’s first pipeline starts, answers false and waits for the next refresh.

§Errors

GitHub’s refusal.

Source

pub fn create_draft( &self, tag: &str, sha: &str, notes: &str, candidate: bool, ) -> Result<String, RkError>

Create an unpublished draft release of tag at sha, which creates no tag, and answer its id.

§Errors

The forge’s refusal.

Source

pub fn upload( &self, tag: &str, files: &[Utf8PathBuf], clobber: bool, ) -> Result<(), RkError>

Upload files to the GitHub release of tag, replacing a same-name asset where clobber says so.

§Errors

The forge’s refusal.

Source

pub fn publish_draft( &self, id: &str, sha: &str, candidate: bool, ) -> Result<(), RkError>

Publish a draft at sha; the publication creates the tag there.

§Errors

The forge’s refusal.

Source

pub fn package_url(&self, version: &str, name: &str) -> String

The URL a GitLab generic package file is served from.

Source

pub fn upload_package( &self, version: &str, file: &Utf8Path, ) -> Result<(), RkError>

Upload one file to the GitLab generic package release at version.

§Errors

The forge’s refusal.

Source

pub fn create_release( &self, tag: &str, sha: &str, description: &str, links: &[(String, String)], ) -> Result<(), RkError>

Create the GitLab release of tag at sha with every link, in one request; the release create creates the tag.

§Errors

The forge’s refusal.

Add one link to the GitLab release of tag.

§Errors

The forge’s refusal.

Trait Implementations§

Source§

impl Clone for Client

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Client

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Forget for Client

§

impl Freeze for Client

§

impl Move for Client

§

impl RefUnwindSafe for Client

§

impl Send for Client

§

impl Sync for Client

§

impl Unpin for Client

§

impl UnsafeUnpin for Client

§

impl UnwindSafe for Client

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.