pub struct ExtensionKey { /* private fields */ }Expand description
A stable namespace identity for one extension value.
URI keys are restricted to normalized HTTPS identifiers without userinfo,
query, or fragment components, or normalized urn: identifiers with a
lowercase RFC 8141 namespace identifier. URI keys are identifiers only and
are never dereferenced. Reverse-DNS keys use at least three lowercase DNS
labels, reserving the leading labels for the controlling organization and
the remaining labels for a versioned feature name.
Implementations§
Source§impl ExtensionKey
impl ExtensionKey
Sourcepub fn new(value: impl Into<String>) -> Result<Self, ExtensionKeyError>
pub fn new(value: impl Into<String>) -> Result<Self, ExtensionKeyError>
Parses and validates a namespaced extension key.
§Errors
Returns ExtensionKeyError when the key is empty, oversized,
non-canonical, uses an unsupported URI form, or violates the strict
reverse-DNS grammar.
Sourcepub const fn kind(&self) -> ExtensionKeyKind
pub const fn kind(&self) -> ExtensionKeyKind
Returns the validated namespace form.
Trait Implementations§
Source§impl AsRef<str> for ExtensionKey
impl AsRef<str> for ExtensionKey
Source§impl Borrow<str> for ExtensionKey
impl Borrow<str> for ExtensionKey
Source§impl Clone for ExtensionKey
impl Clone for ExtensionKey
Source§impl Debug for ExtensionKey
impl Debug for ExtensionKey
Source§impl<'de> Deserialize<'de> for ExtensionKey
impl<'de> Deserialize<'de> for ExtensionKey
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 ExtensionKey
impl Display for ExtensionKey
impl Eq for ExtensionKey
Source§impl From<ExtensionKey> for String
impl From<ExtensionKey> for String
Source§fn from(value: ExtensionKey) -> Self
fn from(value: ExtensionKey) -> Self
Converts to this type from the input type.
Source§impl FromStr for ExtensionKey
impl FromStr for ExtensionKey
Source§impl Hash for ExtensionKey
impl Hash for ExtensionKey
Source§impl JsonSchema for ExtensionKey
impl JsonSchema for ExtensionKey
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 ExtensionKey
impl Ord for ExtensionKey
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 ExtensionKey
impl PartialEq for ExtensionKey
Source§impl PartialOrd for ExtensionKey
impl PartialOrd for ExtensionKey
Source§impl Serialize for ExtensionKey
impl Serialize for ExtensionKey
impl StructuralPartialEq for ExtensionKey
Source§impl TryFrom<&str> for ExtensionKey
impl TryFrom<&str> for ExtensionKey
Auto Trait Implementations§
impl Forget for ExtensionKey
impl Freeze for ExtensionKey
impl Move for ExtensionKey
impl RefUnwindSafe for ExtensionKey
impl Send for ExtensionKey
impl Sync for ExtensionKey
impl Unpin for ExtensionKey
impl UnsafeUnpin for ExtensionKey
impl UnwindSafe for ExtensionKey
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