Skip to main content

Context

Struct Context 

Source
pub struct Context {
    pub target: Utf8PathBuf,
    pub forge: Forge,
    pub repo: String,
    pub trunk: String,
    pub style: Option<Style>,
    pub integration: Integration,
    pub merge_form: MergeForm,
    pub line_prefix: String,
    pub registry: Option<Registry>,
    pub package: Option<String>,
    pub adapter: Box<dyn DriverAdapter>,
}
Expand description

Everything the record answers for one engine run.

Fields§

§target: Utf8PathBuf

The checkout the action runs in.

§forge: Forge

The forge.

§repo: String

The project path on the forge.

§trunk: String

The trunk branch.

§style: Option<Style>

The release style.

§integration: Integration

The integration authority.

§merge_form: MergeForm

The merge form an armed request merges with.

§line_prefix: String

The release-line branch prefix.

§registry: Option<Registry>

The registry the release publishes to, where it has one.

§package: Option<String>

The package name the registry knows, where the driver names one.

§adapter: Box<dyn DriverAdapter>

The driver adapter.

Implementations§

Source§

impl Context

Source

pub fn load(target: &Utf8Path) -> Result<Self, RkError>

Read the record at target.

§Errors

A refusal where the target carries no landing, or a landing the engine does not release.

Source

pub fn driver(&self) -> &'static str

The driver’s name.

Source

pub fn pushed_branch(&self) -> Option<String>

The branch the push landed on: the checked-out branch, or on a detached CI checkout the branch the forge’s job names.

Source

pub fn is_base(&self, branch: &str) -> bool

Whether branch is a release base: the trunk, or a release line <prefix><major>.<minor>.

Source

pub fn is_line(&self, branch: &str) -> bool

Whether branch is a release line.

Source

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

The commit the checkout stands at.

§Errors

A refusal where git cannot resolve HEAD.

Auto Trait Implementations§

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, 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, 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.