pub struct HeaderTemplate {
pub content: String,
pub lines: Vec<String>,
}Fields§
§content: String§lines: Vec<String>Implementations§
Source§impl HeaderTemplate
impl HeaderTemplate
pub fn from_file(path: &Path) -> Result<Self, ForeheadError>
pub fn new(content: &str) -> Self
pub fn substitute(&self, subst: &Substitution) -> String
Sourcepub fn as_comment_lines(
&self,
comment_prefix: &str,
subst: &Substitution,
) -> Vec<String>
pub fn as_comment_lines( &self, comment_prefix: &str, subst: &Substitution, ) -> Vec<String>
Returns the template as a list of comment lines with the given comment style. Each line has the comment prefix applied.
Trait Implementations§
Source§impl Clone for HeaderTemplate
impl Clone for HeaderTemplate
Source§fn clone(&self) -> HeaderTemplate
fn clone(&self) -> HeaderTemplate
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for HeaderTemplate
impl RefUnwindSafe for HeaderTemplate
impl Send for HeaderTemplate
impl Sync for HeaderTemplate
impl Unpin for HeaderTemplate
impl UnsafeUnpin for HeaderTemplate
impl UnwindSafe for HeaderTemplate
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