pub struct PrimitiveName(/* private fields */);Expand description
A validated primitive name identifier.
Primitive names must be valid identifiers that can be used in filenames, environment variables, and configuration. Examples: “timer”, “user_service”, “email-handler”
§Validation Rules
- Cannot be empty
- Must start with a lowercase letter
- Contain only lowercase letters, digits, hyphens, underscores
- Cannot exceed 64 characters
Implementations§
Source§impl PrimitiveName
impl PrimitiveName
Sourcepub const MAX_LENGTH: usize = 64
pub const MAX_LENGTH: usize = 64
Maximum length for a primitive name.
Sourcepub fn new(value: impl Into<String>) -> Result<Self, InvalidPrimitiveName>
pub fn new(value: impl Into<String>) -> Result<Self, InvalidPrimitiveName>
Creates a new primitive name after validation.
§Errors
Returns an error if the primitive name is invalid.
Sourcepub fn is_default(&self) -> bool
pub fn is_default(&self) -> bool
Returns true if this is the default “unknown” value.
This is used to check if a source has been explicitly set.
Trait Implementations§
Source§impl AsRef<str> for PrimitiveName
impl AsRef<str> for PrimitiveName
Source§impl Clone for PrimitiveName
impl Clone for PrimitiveName
Source§fn clone(&self) -> PrimitiveName
fn clone(&self) -> PrimitiveName
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 PrimitiveName
impl Debug for PrimitiveName
Source§impl<'de> Deserialize<'de> for PrimitiveName
impl<'de> Deserialize<'de> for PrimitiveName
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 PrimitiveName
impl Display for PrimitiveName
Source§impl FromStr for PrimitiveName
impl FromStr for PrimitiveName
Source§impl Hash for PrimitiveName
impl Hash for PrimitiveName
Source§impl PartialEq for PrimitiveName
impl PartialEq for PrimitiveName
Source§impl Serialize for PrimitiveName
impl Serialize for PrimitiveName
impl Eq for PrimitiveName
impl StructuralPartialEq for PrimitiveName
Auto Trait Implementations§
impl Freeze for PrimitiveName
impl RefUnwindSafe for PrimitiveName
impl Send for PrimitiveName
impl Sync for PrimitiveName
impl Unpin for PrimitiveName
impl UnsafeUnpin for PrimitiveName
impl UnwindSafe for PrimitiveName
Blanket Implementations§
Source§impl<T> ActonMessage for T
impl<T> ActonMessage for T
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§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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PrefixFactory for T
impl<T> PrefixFactory for T
Source§fn create_prefix_sanitized(&self) -> TypeIdPrefix
fn create_prefix_sanitized(&self) -> TypeIdPrefix
Sanitizes the input and creates a valid
TypeIdPrefix. Read moreSource§fn try_create_prefix(&self) -> Result<TypeIdPrefix, ValidationError>
fn try_create_prefix(&self) -> Result<TypeIdPrefix, ValidationError>
Attempts to create a
TypeIdPrefix from the input without modifying it. Read more