pub struct Environment {
pub entry: String,
pub options: AnalysisOptions,
pub resolved_deps: Vec<ResolvedDep>,
/* private fields */
}Expand description
The reified, content-addressed compilation input — the determinism boundary (#1306).
Everything compile needs is frozen here: the source set (as a
path→hash manifest plus a hash→text
content store), the designated entry,
the fully resolved options, and the reserved
resolved_deps. Because it is a plain serializable
value, it can be hashed (content_hash), cached on,
diffed, and round-tripped.
Consumers read sources only through source_keys
and source_text — never a public sources field.
That is the whole point of the hash-addressed shape: the inline store can
later become a persistent one with no breaking migration.
Fields§
§entry: StringDesignated entry key — its top-level content is the start flow (compilation universe != execution entry, #1296).
options: AnalysisOptionsThe resolved effective policy — the producer already applied
override precedence (CLI/API > brink.toml > default), so compile
does no further resolution.
resolved_deps: Vec<ResolvedDep>Reserved (#1093): resolved external module artifacts (libraries). Empty in v1.
Implementations§
Source§impl Environment
impl Environment
Sourcepub fn source_keys(&self) -> impl Iterator<Item = &str>
pub fn source_keys(&self) -> impl Iterator<Item = &str>
Every source key (root-relative path), in deterministic sorted order.
Sourcepub fn source_text(&self, key: &str) -> Option<Cow<'_, str>>
pub fn source_text(&self, key: &str) -> Option<Cow<'_, str>>
The source text for key, resolved key → hash → store.
Returns Cow (not &str) so the accessor signature is identical for
the inline store (borrows) and a future persistent store (which would
own the read-back text). None if key is not in the manifest.
Sourcepub fn content_hash(&self) -> EnvHash
pub fn content_hash(&self) -> EnvHash
The hash of the whole environment — over manifest + entry + options +
deps. A reproducible-build / cache key (see EnvHash).
Trait Implementations§
Source§impl Clone for Environment
impl Clone for Environment
Source§fn clone(&self) -> Environment
fn clone(&self) -> Environment
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Environment
impl Debug for Environment
Source§impl<'de> Deserialize<'de> for Environment
impl<'de> Deserialize<'de> for Environment
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Environment
Source§impl PartialEq for Environment
impl PartialEq for Environment
Source§impl Serialize for Environment
impl Serialize for Environment
impl StructuralPartialEq for Environment
Auto Trait Implementations§
impl Freeze for Environment
impl RefUnwindSafe for Environment
impl Send for Environment
impl Sync for Environment
impl Unpin for Environment
impl UnsafeUnpin for Environment
impl UnwindSafe for Environment
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.