pub struct ObjectiveId(pub String);Expand description
Objective id: obj/<kebab> (stage-local to stage 5).
Tuple Fields§
§0: StringImplementations§
Source§impl ObjectiveId
impl ObjectiveId
Sourcepub fn is_valid_syntax(&self) -> bool
pub fn is_valid_syntax(&self) -> bool
True if the id is well-formed: <prefix>/<kebab>.
Sourcepub fn syntax_form(&self) -> String
pub fn syntax_form(&self) -> String
The form THIS id has to take, for the diagnostic that rejected
one — `npc/<kebab>`, `dlg/<kebab>`, and so on.
A refusal that says only “ids must be lowercase kebab-case with
their type prefix” and then lists three examples of other types
has told the author the general rule and withheld the one fact
they were missing: which prefix THIS field takes. The prefix is
a property of the id type, so the answer is derived from the
type at every site rather than hand-written per site — the
per-section refusals that already name their own prefix
(wave/, trap/, loot/, …) are that fact copied by hand,
which is exactly why the general path never had it.
Trait Implementations§
Source§impl Clone for ObjectiveId
impl Clone for ObjectiveId
Source§impl Debug for ObjectiveId
impl Debug for ObjectiveId
Source§impl<'de> Deserialize<'de> for ObjectiveId
impl<'de> Deserialize<'de> for ObjectiveId
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 ObjectiveId
impl Display for ObjectiveId
impl Eq for ObjectiveId
Source§impl Hash for ObjectiveId
impl Hash for ObjectiveId
Source§impl JsonSchema for ObjectiveId
impl JsonSchema for ObjectiveId
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(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &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 ObjectiveId
impl Ord for ObjectiveId
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 ObjectiveId
impl PartialEq for ObjectiveId
Source§impl PartialOrd for ObjectiveId
impl PartialOrd for ObjectiveId
Source§impl Serialize for ObjectiveId
impl Serialize for ObjectiveId
impl StructuralPartialEq for ObjectiveId
Auto Trait Implementations§
impl Freeze for ObjectiveId
impl RefUnwindSafe for ObjectiveId
impl Send for ObjectiveId
impl Sync for ObjectiveId
impl Unpin for ObjectiveId
impl UnsafeUnpin for ObjectiveId
impl UnwindSafe for ObjectiveId
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