pub struct FeaturesJson(/* private fields */);Expand description
A canonical features list: strictly sorted, deduplicated.
On the wire this serializes as a JSON-encoded string (e.g.
"[\"default\",\"std\"]") so it is byte-compatible with the legacy
features_json: String shape used by BuildTaskPayload and friends.
Implementations§
Source§impl FeaturesJson
impl FeaturesJson
Sourcepub fn from_sorted(features: Vec<String>) -> Result<Self, IdentityError>
pub fn from_sorted(features: Vec<String>) -> Result<Self, IdentityError>
Construct from an already-sorted, deduplicated list of features.
§Errors
Returns IdentityError::InvalidFeatureName for a malformed feature,
or IdentityError::UnsortedFeatures when the list violates the
sorted/deduplicated invariant.
Sourcepub fn canonicalize(features: Vec<String>) -> Result<Self, IdentityError>
pub fn canonicalize(features: Vec<String>) -> Result<Self, IdentityError>
Sort, deduplicate, and validate a raw feature list, then construct.
§Errors
Returns IdentityError::InvalidFeatureName when a feature name is
malformed.
Trait Implementations§
Source§impl Clone for FeaturesJson
impl Clone for FeaturesJson
Source§impl Debug for FeaturesJson
impl Debug for FeaturesJson
Source§impl Default for FeaturesJson
impl Default for FeaturesJson
Source§impl<'de> Deserialize<'de> for FeaturesJson
impl<'de> Deserialize<'de> for FeaturesJson
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for FeaturesJson
impl Display for FeaturesJson
impl Eq for FeaturesJson
Source§impl Hash for FeaturesJson
impl Hash for FeaturesJson
Source§impl Ord for FeaturesJson
impl Ord for FeaturesJson
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 FeaturesJson
impl PartialEq for FeaturesJson
Source§impl PartialOrd for FeaturesJson
impl PartialOrd for FeaturesJson
Source§impl PartialSchema for FeaturesJson
impl PartialSchema for FeaturesJson
Source§impl Serialize for FeaturesJson
impl Serialize for FeaturesJson
impl StructuralPartialEq for FeaturesJson
Auto Trait Implementations§
impl Freeze for FeaturesJson
impl RefUnwindSafe for FeaturesJson
impl Send for FeaturesJson
impl Sync for FeaturesJson
impl Unpin for FeaturesJson
impl UnsafeUnpin for FeaturesJson
impl UnwindSafe for FeaturesJson
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.