pub struct Template { /* private fields */ }Expand description
A configured string from args, env, or cwd, parsed for expansion.
Parsing is infallible: anything that is not exactly ${PLUGIN_ROOT} or
${PLUGIN_DATA} — including $PLUGIN_ROOT, ${plugin_root}, ${HOME} —
remains literal text, as §9.2 requires.
Implementations§
Source§impl Template
impl Template
Sourcepub fn parse(raw: &str) -> Self
pub fn parse(raw: &str) -> Self
Parse a configured string into literal and placeholder segments.
Sourcepub fn has_anchors(&self) -> bool
pub fn has_anchors(&self) -> bool
Whether any recognized placeholder appears.
Sourcepub fn expand(&self, anchors: &Anchors) -> String
pub fn expand(&self, anchors: &Anchors) -> String
Expand against the given anchors: each placeholder becomes its anchor path, each literal passes through untouched. Because replacement text lives in its own segment, it is never rescanned — the non-recursion guarantee of §9.2 holds by construction.
Trait Implementations§
impl Eq for Template
impl StructuralPartialEq for Template
Auto Trait Implementations§
impl Freeze for Template
impl RefUnwindSafe for Template
impl Send for Template
impl Sync for Template
impl Unpin for Template
impl UnsafeUnpin for Template
impl UnwindSafe for Template
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
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
Compare self to
key and return true if they are equal.