pub struct TemplateName(/* private fields */);Expand description
A template name (e.g. "gov_proposal", "letter").
§Examples
use hwpforge_foundation::TemplateName;
let t = TemplateName::new("gov_proposal").unwrap();
assert_eq!(t.as_str(), "gov_proposal");Implementations§
Source§impl TemplateName
impl TemplateName
Sourcepub fn new(value: impl Into<String>) -> FoundationResult<Self>
pub fn new(value: impl Into<String>) -> FoundationResult<Self>
Creates a new identifier, validating it is non-empty.
§Errors
Returns crate::FoundationError::EmptyIdentifier when value
is empty.
Trait Implementations§
Source§impl AsRef<str> for TemplateName
impl AsRef<str> for TemplateName
Source§impl Clone for TemplateName
impl Clone for TemplateName
Source§fn clone(&self) -> TemplateName
fn clone(&self) -> TemplateName
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 moreSource§impl Debug for TemplateName
impl Debug for TemplateName
Source§impl<'de> Deserialize<'de> for TemplateName
impl<'de> Deserialize<'de> for TemplateName
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for TemplateName
impl Display for TemplateName
Source§impl Hash for TemplateName
impl Hash for TemplateName
Source§impl JsonSchema for TemplateName
impl JsonSchema for TemplateName
Source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for TemplateName
impl PartialEq for TemplateName
Source§impl Serialize for TemplateName
impl Serialize for TemplateName
impl Eq for TemplateName
impl StructuralPartialEq for TemplateName
Auto Trait Implementations§
impl Freeze for TemplateName
impl RefUnwindSafe for TemplateName
impl Send for TemplateName
impl Sync for TemplateName
impl Unpin for TemplateName
impl UnwindSafe for TemplateName
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.