pub struct FeatureId {
pub namespace: FeatureNamespace,
pub kind: FeatureKind,
pub name: String,
}Expand description
A stable, locale-independent Workshop feature identity.
Fields§
§namespace: FeatureNamespaceThe WrightKit repository-owned namespace for this identity.
kind: FeatureKindThe semantic category of the feature.
name: StringThe canonical name within the category.
Implementations§
Source§impl FeatureId
impl FeatureId
Sourcepub fn new(
namespace: FeatureNamespace,
kind: FeatureKind,
name: impl Into<String>,
) -> Result<Self, ConformanceError>
pub fn new( namespace: FeatureNamespace, kind: FeatureKind, name: impl Into<String>, ) -> Result<Self, ConformanceError>
Construct a feature identity from a canonical category and name.
Names are intentionally opaque to this contract because catalog and WIR owners define their canonical names. Whitespace and control characters are rejected so serialized identities remain unambiguous.
Sourcepub fn from_catalog(
kind: Kind,
id: impl Into<String>,
) -> Result<Self, ConformanceError>
pub fn from_catalog( kind: Kind, id: impl Into<String>, ) -> Result<Self, ConformanceError>
Construct a feature identity from a canonical catalog kind and id.
Sourcepub fn from_enum_member(
domain: impl Into<String>,
member: impl Into<String>,
) -> Result<Self, ConformanceError>
pub fn from_enum_member( domain: impl Into<String>, member: impl Into<String>, ) -> Result<Self, ConformanceError>
Construct a canonical enum-member identity that retains its domain.
Sourcepub fn owned(
namespace: FeatureNamespace,
kind: FeatureKind,
name: impl Into<String>,
) -> Result<Self, ConformanceError>
pub fn owned( namespace: FeatureNamespace, kind: FeatureKind, name: impl Into<String>, ) -> Result<Self, ConformanceError>
Construct a feature identity owned by Workshop IR or another
workshop-rs namespace.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FeatureId
impl<'de> Deserialize<'de> for FeatureId
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
impl Eq for FeatureId
impl StructuralPartialEq for FeatureId
Auto Trait Implementations§
impl Freeze for FeatureId
impl RefUnwindSafe for FeatureId
impl Send for FeatureId
impl Sync for FeatureId
impl Unpin for FeatureId
impl UnsafeUnpin for FeatureId
impl UnwindSafe for FeatureId
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