chore: comment

This commit is contained in:
2025-08-07 21:00:32 +08:00
parent f946cb2fd1
commit 67cdcfea33
24 changed files with 734 additions and 105 deletions

View File

@@ -1,10 +1,19 @@
//! Defines a placeholder for Nix's contextful strings.
//!
//! In Nix, strings can carry a "context" which affects how they are
//! handled, particularly with regards to path resolution. This module
//! provides the basic structures for this feature, although it is
//! currently a work in progress.
// TODO: Contextful String
/// Represents the context associated with a string.
pub struct StringContext {
context: Vec<()>,
}
impl StringContext {
/// Creates a new, empty `StringContext`.
pub fn new() -> StringContext {
StringContext {
context: Vec::new(),
@@ -12,12 +21,14 @@ impl StringContext {
}
}
/// A string that carries an associated context.
pub struct ContextfulString {
string: String,
context: StringContext,
}
impl ContextfulString {
/// Creates a new `ContextfulString` from a standard `String`.
pub fn new(string: String) -> ContextfulString {
ContextfulString {
string,