Struct compose_spec::ExtensionKey
source · pub struct ExtensionKey(/* private fields */);Expand description
Valid extension key string.
Extension keys must start with “x-” and cannot contain multiple lines.
Implementations§
source§impl ExtensionKey
impl ExtensionKey
sourcepub fn new<T>(key: T) -> Result<Self, InvalidExtensionKeyError>
pub fn new<T>(key: T) -> Result<Self, InvalidExtensionKeyError>
Create a new ExtensionKey, validating the given string.
§Errors
Returns an error if the given string is not a valid ExtensionKey.
Extension keys must start with “x-” and cannot have multiple lines (i.e. contain the newline
\n character).
sourcepub fn strip_prefix(&self) -> &str
pub fn strip_prefix(&self) -> &str
Returns the underlying string slice with the “x-” prefix removed.
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§fn clone(&self) -> ExtensionKey
fn clone(&self) -> ExtensionKey
Returns a copy 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 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
source§impl From<ExtensionKey> for Box<str>
impl From<ExtensionKey> for Box<str>
source§fn from(value: ExtensionKey) -> Self
fn from(value: ExtensionKey) -> Self
Converts to this type from the input type.
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 Ord for ExtensionKey
impl Ord for ExtensionKey
source§fn cmp(&self, other: &ExtensionKey) -> Ordering
fn cmp(&self, other: &ExtensionKey) -> Ordering
1.21.0 · 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
source§impl PartialEq<&str> for ExtensionKey
impl PartialEq<&str> for ExtensionKey
source§impl PartialEq<str> for ExtensionKey
impl PartialEq<str> for ExtensionKey
source§impl PartialEq for ExtensionKey
impl PartialEq for ExtensionKey
source§fn eq(&self, other: &ExtensionKey) -> bool
fn eq(&self, other: &ExtensionKey) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialOrd for ExtensionKey
impl PartialOrd for ExtensionKey
source§fn partial_cmp(&self, other: &ExtensionKey) -> Option<Ordering>
fn partial_cmp(&self, other: &ExtensionKey) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresource§impl Serialize for ExtensionKey
impl Serialize for ExtensionKey
source§impl TryFrom<&str> for ExtensionKey
impl TryFrom<&str> for ExtensionKey
source§impl TryFrom<String> for ExtensionKey
impl TryFrom<String> for ExtensionKey
impl Eq for ExtensionKey
impl StructuralPartialEq for ExtensionKey
Auto Trait Implementations§
impl Freeze for ExtensionKey
impl RefUnwindSafe for ExtensionKey
impl Send for ExtensionKey
impl Sync for ExtensionKey
impl Unpin 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
source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<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.