pub struct CustomKind(/* private fields */);Expand description
Kind of a custom content part, in provider.type form.
Implementations§
Source§impl CustomKind
impl CustomKind
Sourcepub fn parse(text: impl Into<String>) -> Result<Self, InvalidCustomKind>
pub fn parse(text: impl Into<String>) -> Result<Self, InvalidCustomKind>
Parses a kind; it must be <provider>.<type> with non-empty halves.
§Errors
Returns InvalidCustomKind when the text does not contain exactly
one separating dot with non-empty text on both sides.
Sourcepub fn new(provider: &str, kind: &str) -> Result<Self, InvalidCustomKind>
pub fn new(provider: &str, kind: &str) -> Result<Self, InvalidCustomKind>
Builds a kind from its two halves.
§Errors
Returns InvalidCustomKind when either half is empty or contains
whitespace or a dot.
Trait Implementations§
Source§impl AsRef<str> for CustomKind
impl AsRef<str> for CustomKind
Source§impl Clone for CustomKind
impl Clone for CustomKind
Source§fn clone(&self) -> CustomKind
fn clone(&self) -> CustomKind
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 CustomKind
impl Debug for CustomKind
Source§impl<'de> Deserialize<'de> for CustomKind
impl<'de> Deserialize<'de> for CustomKind
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 CustomKind
impl Display for CustomKind
impl Eq for CustomKind
Source§impl From<CustomKind> for String
impl From<CustomKind> for String
Source§fn from(kind: CustomKind) -> Self
fn from(kind: CustomKind) -> Self
Converts to this type from the input type.
Source§impl Hash for CustomKind
impl Hash for CustomKind
Source§impl Ord for CustomKind
impl Ord for CustomKind
Source§fn cmp(&self, other: &CustomKind) -> Ordering
fn cmp(&self, other: &CustomKind) -> Ordering
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 CustomKind
impl PartialEq for CustomKind
Source§impl PartialOrd for CustomKind
impl PartialOrd for CustomKind
Source§impl Serialize for CustomKind
impl Serialize for CustomKind
impl StructuralPartialEq for CustomKind
Auto Trait Implementations§
impl Freeze for CustomKind
impl RefUnwindSafe for CustomKind
impl Send for CustomKind
impl Sync for CustomKind
impl Unpin for CustomKind
impl UnsafeUnpin for CustomKind
impl UnwindSafe for CustomKind
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.