Skip to main content

State

Struct State 

Source
pub struct State {
Show 17 fields pub derivation_infos: IndexMap<DerivationId, DerivationInfo>, pub store_path_infos: IndexMap<StorePathId, StorePathInfo>, pub full_summary: DependencySummary, pub forest_roots: Vec<DerivationId>, pub build_cache: HashMap<(String, String), Vec<BuildReport>>, pub start_time: f64, pub progress_state: ProgressState, pub store_path_ids: HashMap<StorePath, StorePathId>, pub derivation_ids: HashMap<Derivation, DerivationId>, pub touched_ids: HashSet<DerivationId>, pub activities: HashMap<ActivityId, ActivityStatus>, pub nix_errors: Vec<String>, pub build_logs: Vec<String>, pub traces: Vec<String>, pub build_platform: Option<String>, pub evaluation_state: EvalInfo, pub builds_activity: Option<ActivityId>, /* private fields */
}
Expand description

Main state for ROM

Fields§

§derivation_infos: IndexMap<DerivationId, DerivationInfo>§store_path_infos: IndexMap<StorePathId, StorePathInfo>§full_summary: DependencySummary§forest_roots: Vec<DerivationId>§build_cache: HashMap<(String, String), Vec<BuildReport>>§start_time: f64§progress_state: ProgressState§store_path_ids: HashMap<StorePath, StorePathId>§derivation_ids: HashMap<Derivation, DerivationId>§touched_ids: HashSet<DerivationId>§activities: HashMap<ActivityId, ActivityStatus>§nix_errors: Vec<String>§build_logs: Vec<String>§traces: Vec<String>§build_platform: Option<String>§evaluation_state: EvalInfo§builds_activity: Option<ActivityId>

Implementations§

Source§

impl State

Source

pub fn new() -> Self

Source

pub fn with_platform(platform: Option<String>) -> Self

Source

pub fn get_or_create_store_path_id(&mut self, path: StorePath) -> StorePathId

Source

pub fn get_or_create_derivation_id(&mut self, drv: Derivation) -> DerivationId

Source

pub fn populate_derivation_dependencies(&mut self, drv_id: DerivationId)

Populate derivation dependencies by parsing its .drv file

Source

pub fn get_derivation_info(&self, id: DerivationId) -> Option<&DerivationInfo>

Source

pub fn get_derivation_info_mut( &mut self, id: DerivationId, ) -> Option<&mut DerivationInfo>

Source

pub fn get_store_path_info(&self, id: StorePathId) -> Option<&StorePathInfo>

Source

pub fn get_store_path_info_mut( &mut self, id: StorePathId, ) -> Option<&mut StorePathInfo>

Source

pub fn update_build_status(&mut self, id: DerivationId, new_status: BuildStatus)

Source

pub fn has_errors(&self) -> bool

Source

pub fn total_builds(&self) -> usize

Source

pub fn running_builds_for_host( &self, host: &Host, ) -> Vec<(DerivationId, &BuildInfo)>

Source

pub fn has_platform_mismatch(&self, id: DerivationId) -> bool

Check if a derivation has a platform mismatch

Source

pub fn platform_mismatches(&self) -> Vec<DerivationId>

Get all derivations with platform mismatches

Source

pub fn get_activity_prefix( &self, activity_id: ActivityId, prefix_style: &LogPrefixStyle, use_color: bool, ) -> Option<String>

Get the activity prefix for a given activity ID by walking up the parent chain to find a Build activity and extracting its derivation name. Returns a prefix like “hello> “ suitable for prepending to log lines. If use_color is true and stderr is a TTY, the prefix will be blue. The prefix_style determines whether to use short (pname only), full, or no prefix.

Trait Implementations§

Source§

impl Clone for State

Source§

fn clone(&self) -> State

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for State

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for State

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for State

§

impl RefUnwindSafe for State

§

impl Send for State

§

impl Sync for State

§

impl Unpin for State

§

impl UnsafeUnpin for State

§

impl UnwindSafe for State

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> 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> 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 = 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