pub struct CapabilityName(/* private fields */);Expand description
A stable, case-sensitive capability name.
Names contain 1 to 128 ASCII letters, digits, _, -, or .. This is
the tool-name grammar from the MCP 2026-07-28 specification, made
mandatory at the StateKnot domain boundary. A name is unique only within
its owning registry; owner/provenance remains a separate identity field.
Implementations§
Source§impl CapabilityName
impl CapabilityName
Sourcepub fn new(value: impl Into<String>) -> Result<Self, CapabilityNameError>
pub fn new(value: impl Into<String>) -> Result<Self, CapabilityNameError>
Validates and constructs a capability name without copying a String.
§Errors
Returns CapabilityNameError when value is empty, too long, or
contains a byte outside the stable ASCII grammar.
Trait Implementations§
Source§impl AsRef<str> for CapabilityName
impl AsRef<str> for CapabilityName
Source§impl Borrow<str> for CapabilityName
impl Borrow<str> for CapabilityName
Source§impl Clone for CapabilityName
impl Clone for CapabilityName
Source§impl Debug for CapabilityName
impl Debug for CapabilityName
Source§impl<'de> Deserialize<'de> for CapabilityName
impl<'de> Deserialize<'de> for CapabilityName
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 CapabilityName
impl Display for CapabilityName
impl Eq for CapabilityName
Source§impl From<CapabilityName> for String
impl From<CapabilityName> for String
Source§fn from(value: CapabilityName) -> Self
fn from(value: CapabilityName) -> Self
Converts to this type from the input type.
Source§impl FromStr for CapabilityName
impl FromStr for CapabilityName
Source§impl Hash for CapabilityName
impl Hash for CapabilityName
Source§impl JsonSchema for CapabilityName
impl JsonSchema for CapabilityName
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(_: &mut SchemaGenerator) -> Schema
fn json_schema(_: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§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 Ord for CapabilityName
impl Ord for CapabilityName
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for CapabilityName
impl PartialEq for CapabilityName
Source§impl PartialOrd for CapabilityName
impl PartialOrd for CapabilityName
Source§impl Serialize for CapabilityName
impl Serialize for CapabilityName
impl StructuralPartialEq for CapabilityName
Source§impl TryFrom<&str> for CapabilityName
impl TryFrom<&str> for CapabilityName
Auto Trait Implementations§
impl Forget for CapabilityName
impl Freeze for CapabilityName
impl Move for CapabilityName
impl RefUnwindSafe for CapabilityName
impl Send for CapabilityName
impl Sync for CapabilityName
impl Unpin for CapabilityName
impl UnsafeUnpin for CapabilityName
impl UnwindSafe for CapabilityName
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