pub struct ModeSlug(/* private fields */);Expand description
A stable slug identifying an execution mode.
Implementations§
Source§impl ModeSlug
impl ModeSlug
Sourcepub fn new(value: impl Into<String>) -> Result<Self, DomainTypeError>
pub fn new(value: impl Into<String>) -> Result<Self, DomainTypeError>
Creates a validated mode slug.
Mode slugs are stable identifiers used in policy files and orchestration
logic. They are intentionally restricted to lowercase ASCII letters,
digits, -, and _.
§Errors
Returns DomainTypeError when the value is empty or contains
unsupported characters.
§Examples
use agent_domain::ModeSlug;
let slug = ModeSlug::new("implementer")?;
assert_eq!(slug.as_str(), "implementer");Sourcepub fn into_inner(self) -> String
pub fn into_inner(self) -> String
Consumes the slug and returns the inner string.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ModeSlug
impl<'de> Deserialize<'de> for ModeSlug
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 Ord for ModeSlug
impl Ord for ModeSlug
Source§impl PartialOrd for ModeSlug
impl PartialOrd for ModeSlug
impl Eq for ModeSlug
impl StructuralPartialEq for ModeSlug
Auto Trait Implementations§
impl Freeze for ModeSlug
impl RefUnwindSafe for ModeSlug
impl Send for ModeSlug
impl Sync for ModeSlug
impl Unpin for ModeSlug
impl UnsafeUnpin for ModeSlug
impl UnwindSafe for ModeSlug
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