pub struct FlakeRef {
pub flake_dir: PathBuf,
pub attribute: String,
}Expand description
A parsed flake reference like .#cid or path/to/flake#hostname.
Fields§
§flake_dir: PathBufThe directory containing the flake.
attribute: StringThe attribute path after the #.
Implementations§
Source§impl FlakeRef
impl FlakeRef
Sourcepub fn parse(input: &str) -> Result<Self, FlakeRefError>
pub fn parse(input: &str) -> Result<Self, FlakeRefError>
Parse a CLI-style flake reference.
§Format
<path>#<attribute> where <path> is a filesystem path and
<attribute> is a dot-separated Nix attribute path.
§Examples
.#cid— current directory, attributecid/path/to/nix#cid— absolute path, attributecidrelative/path#attr— relative path, attributeattr.#— current directory, empty attribute (allowed)
§Errors
Returns FlakeRefError::MissingAttribute if the input does not
contain a # separator, and FlakeRefError::InvalidPath if the
current directory cannot be resolved (only when path is . or empty).
Trait Implementations§
impl Eq for FlakeRef
impl StructuralPartialEq for FlakeRef
Auto Trait Implementations§
impl Freeze for FlakeRef
impl RefUnwindSafe for FlakeRef
impl Send for FlakeRef
impl Sync for FlakeRef
impl Unpin for FlakeRef
impl UnsafeUnpin for FlakeRef
impl UnwindSafe for FlakeRef
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
Mutably borrows from an owned value. Read more