chore: comment
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user