#[non_exhaustive]pub struct LockEntry {
pub id: String,
pub path: String,
pub sha: String,
pub branch: String,
pub installed_at: DateTime<Utc>,
pub actions_hash: String,
pub schema_version: String,
pub synthetic: bool,
}Expand description
One resolved pack entry. Serialized as a single JSON line.
Marked #[non_exhaustive] so future audit fields (timestamps,
resolved-ref metadata, plugin signatures) can land without breaking
out-of-crate consumers that struct-literal-construct entries.
Within grex-core the existing struct-literal sites continue to
work unchanged; external callers should use LockEntry::new (and
the field-level pub mutators) instead of struct literals.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: StringPack identifier — matches the manifest id.
path: StringParent-relative POSIX path of this pack’s manifest within its
parent’s manifest.children. Required for v1.2.0 distributed
lockfile resolution: each entry knows where its manifest lives
relative to the parent meta, so the walker can place the dest
correctly even when the same id appears nested.
Read-fallback: v1.1.1 lockfiles do not carry this field; on
deserialize a missing path is filled with id (the v1.1.1 1:1
id↔folder convention). See LockEntryRepr and
openspec/feat-grex/spec.md (v1.2.0 distributed lockfile).
Validation: must be parent-relative POSIX (no .., no
absolute, no backslash, non-empty). Use LockEntry::validate_path.
sha: StringResolved commit SHA at the time of install.
branch: StringBranch or ref used to resolve sha.
installed_at: DateTime<Utc>Timestamp of the last successful install/sync.
actions_hash: StringContent hash of the declarative actions that ran. Empty for imperative packs.
schema_version: StringSchema version of this entry.
synthetic: booltrue when the walker synthesised this pack’s manifest in-memory
because the child had no .grex/pack.yaml but did carry a
.git/ (v1.1.1 plain-git children). #[serde(default)] keeps
pre-v1.1.1 lockfiles forward-compatible — a missing field
deserialises to false. See
openspec/changes/feat-v1.1.1-plain-git-children/design.md.
Implementations§
Source§impl LockEntry
impl LockEntry
Sourcepub fn new(
id: impl Into<String>,
sha: impl Into<String>,
branch: impl Into<String>,
installed_at: DateTime<Utc>,
actions_hash: impl Into<String>,
schema_version: impl Into<String>,
) -> Self
pub fn new( id: impl Into<String>, sha: impl Into<String>, branch: impl Into<String>, installed_at: DateTime<Utc>, actions_hash: impl Into<String>, schema_version: impl Into<String>, ) -> Self
Construct a new entry with every required field. The synthetic
flag defaults to false; callers that need a synthetic entry
should set the field directly after construction (the field is
pub).
path defaults to id to preserve v1.1.1 caller compatibility
(v1.1.1’s 1:1 id↔folder convention). Callers that need a
distinct manifest path should set the field directly after
construction.
Because LockEntry is #[non_exhaustive], this is the
canonical constructor for out-of-crate consumers — struct
literals will not compile from outside the crate.
Sourcepub fn validate_path(path: &str) -> Result<(), LockfileError>
pub fn validate_path(path: &str) -> Result<(), LockfileError>
Validate that path is a parent-relative POSIX path.
Rejects:
- empty string
- any
..segment (parent traversal) - absolute paths: leading
/, or a Windows drive prefix likeC: - backslash separators (Windows-style — POSIX only)
Accepts: simple names (foo), nested POSIX (a/b/c).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for LockEntry
impl<'de> Deserialize<'de> for LockEntry
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 LockEntry
impl StructuralPartialEq for LockEntry
Auto Trait Implementations§
impl Freeze for LockEntry
impl RefUnwindSafe for LockEntry
impl Send for LockEntry
impl Sync for LockEntry
impl Unpin for LockEntry
impl UnsafeUnpin for LockEntry
impl UnwindSafe for LockEntry
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,
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.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§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more