pub struct AppName(/* private fields */);Expand description
A typed wrapper around the logical application name used in session addressing.
§Examples
use adk_core::identity::AppName;
let app: AppName = "my-app".parse().unwrap();
assert_eq!(app.as_ref(), "my-app");
// Empty values are rejected
assert!(AppName::try_from("").is_err());Implementations§
Source§impl AppName
impl AppName
Sourcepub fn new(value: impl Into<String>) -> Result<Self, IdentityError>
pub fn new(value: impl Into<String>) -> Result<Self, IdentityError>
Creates a typed identifier with validation.
Prefer this constructor at trust boundaries where the input may come from users, HTTP payloads, or external systems.
Sourcepub fn new_unchecked(value: impl Into<String>) -> Self
pub fn new_unchecked(value: impl Into<String>) -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AppName
impl<'de> Deserialize<'de> for AppName
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 AppName
impl Ord for AppName
Source§impl PartialOrd for AppName
impl PartialOrd for AppName
impl Eq for AppName
impl StructuralPartialEq for AppName
Auto Trait Implementations§
impl Freeze for AppName
impl RefUnwindSafe for AppName
impl Send for AppName
impl Sync for AppName
impl Unpin for AppName
impl UnsafeUnpin for AppName
impl UnwindSafe for AppName
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