pub struct Placeholder {
pub name: String,
pub case_transform: CaseTransform,
pub required: bool,
pub default: Option<String>,
}Expand description
Represents a placeholder in a template
Fields§
§name: StringThe base name of the placeholder (without case suffix)
case_transform: CaseTransformThe case transformation to apply
required: boolWhether this placeholder is required
default: Option<String>Default value if not provided
Implementations§
Source§impl Placeholder
impl Placeholder
Sourcepub fn new(name: String, case_transform: CaseTransform) -> Self
pub fn new(name: String, case_transform: CaseTransform) -> Self
Create a new placeholder with the given name and case transform
Sourcepub fn with_required(self, required: bool) -> Self
pub fn with_required(self, required: bool) -> Self
Set whether this placeholder is required
Sourcepub fn with_default(self, default: String) -> Self
pub fn with_default(self, default: String) -> Self
Set a default value for this placeholder
Trait Implementations§
Source§impl Clone for Placeholder
impl Clone for Placeholder
Source§fn clone(&self) -> Placeholder
fn clone(&self) -> Placeholder
Returns a duplicate of the value. Read more
1.0.0 · 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 Placeholder
impl RefUnwindSafe for Placeholder
impl Send for Placeholder
impl Sync for Placeholder
impl Unpin for Placeholder
impl UnwindSafe for Placeholder
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