Skip to main content

Ctx

Struct Ctx 

Source
pub struct Ctx {
    pub target: Utf8PathBuf,
    pub repo: String,
    pub forge: Forge,
    pub host: Option<String>,
    pub required_check: Option<String>,
    pub cli: PathBuf,
    pub tech: Option<&'static str>,
    /* private fields */
}
Expand description

One resolved run context.

Fields§

§target: Utf8PathBuf

The repository being set up.

§repo: String

The project path on the forge.

§forge: Forge

The forge the run acts on.

§host: Option<String>

The remote host, where one was detected.

§required_check: Option<String>

The value of --required-check, where given.

§cli: PathBuf

The resolved forge CLI binary.

§tech: Option<&'static str>

The detected technology, where the version file names one.

Implementations§

Source§

impl Ctx

Source

pub fn resolve( target: &Utf8PathBuf, repo_flag: Option<&str>, forge_flag: Option<&str>, required_check: Option<&str>, ) -> Result<Self, RkError>

Resolve detection, overrides, and the forge CLI in one pass, before any step runs.

§Errors

Refuses when the target is missing, when no remote resolves and no override covers the gap, when the host is unrecognized, and when the forge CLI is not on PATH.

Source

pub fn trunk(&self) -> &str

The one permanent branch this run asserts.

Source

pub fn line_prefix(&self) -> &str

The release-line prefix this run asserts.

Source

pub fn retired_branches(&self) -> &[String]

The long-lived branches this run’s single-trunk step retires.

Source

pub const fn release_lines(&self) -> bool

Whether a full apply runs the release-line protection.

Source

pub fn bot_app_id(&self) -> Option<&str>

The bot App’s public identifier this target states, where it does.

Source

pub fn trunk_ruleset(&self) -> &str

The ruleset that protects the trunk.

Source

pub fn tag_ruleset(&self) -> &str

The ruleset that makes published tags immutable.

Source

pub fn lines_ruleset(&self) -> &str

The ruleset that protects the release lines.

Source

pub fn title_check(&self) -> &str

The context the landed title job reports under.

Source

pub const fn protection(&self) -> &Protection

The floored policy this target states, already judged at load.

Source

pub fn self_hosted_gitlab(&self) -> bool

Whether this run targets a GitLab instance that is not gitlab.com, where registry trusted publishing cannot reach.

Source

pub fn child_env(&self, step: &str) -> Vec<(OsString, OsString)>

The constructed environment a step receives. Secrets enter only for the step that consumes them; the caller records their handling.

Source

pub fn secret_values() -> Vec<Zeroizing<Vec<u8>>>

The secret bytes a run must keep out of its own output: the values the environment carries. Every buffer is scrubbed on drop; none is ever logged or echoed.

Key material is not read here. The step that transmits a key adds the very bytes it sends, so the needle cannot describe one file while the child receives another.

Trait Implementations§

Source§

impl Clone for Ctx

Source§

fn clone(&self) -> Ctx

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 Ctx

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Ctx

§

impl RefUnwindSafe for Ctx

§

impl Send for Ctx

§

impl Sync for Ctx

§

impl Unpin for Ctx

§

impl UnsafeUnpin for Ctx

§

impl UnwindSafe for Ctx

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.