pub struct FlakeLock { /* private fields */ }Expand description
Parsed flake.lock. Loaded with Self::from_default_path,
Self::from_file, or Self::read_from_str.
Implementations§
Source§impl FlakeLock
impl FlakeLock
Sourcepub fn from_default_path() -> Result<Self, Error>
pub fn from_default_path() -> Result<Self, Error>
Load flake.lock from the current directory.
Sourcepub fn from_file<P: AsRef<Path>>(path: P) -> Result<Self, Error>
pub fn from_file<P: AsRef<Path>>(path: P) -> Result<Self, Error>
Load and parse a lockfile from path.
Sourcepub fn read_from_str(str: &str) -> Result<Self, Error>
pub fn read_from_str(str: &str) -> Result<Self, Error>
Parse lockfile JSON from str.
Sourcepub fn rev_for(&self, path: &AttrPath) -> Result<String, Error>
pub fn rev_for(&self, path: &AttrPath) -> Result<String, Error>
Resolve path to its locked revision.
§Errors
Returns a Error::Lock wrapping the underlying
LockError if any segment is missing in the lock graph, the
resolved node is not present, or it carries no rev.
Sourcepub fn nested_inputs(&self) -> Vec<NestedInput>
pub fn nested_inputs(&self) -> Vec<NestedInput>
All nested inputs reachable from the root, with their existing follows targets.
Walks flake.lock recursively from the root, emitting one entry per
inputs.X on any descendant node and building the path
segment-by-segment. Capped at NESTED_INPUTS_MAX_DEPTH. Cycles in
the node graph are broken by a visited set keyed on node name.
Output is sorted by path for stable emission order.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FlakeLock
impl<'de> Deserialize<'de> for FlakeLock
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>,
Auto Trait Implementations§
impl Freeze for FlakeLock
impl RefUnwindSafe for FlakeLock
impl Send for FlakeLock
impl Sync for FlakeLock
impl Unpin for FlakeLock
impl UnsafeUnpin for FlakeLock
impl UnwindSafe for FlakeLock
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
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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