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