@@ -56,7 +56,7 @@ use quote::ToTokens;
5656///
5757/// By default, for a kind `Foo`, this macro generates:
5858///
59- /// * A `FooKind` type that implements `TypedUuidKind`: `pub type FooKind {}`.
59+ /// * A `FooKind` type that implements `TypedUuidKind`: `pub enum FooKind {}`.
6060/// * A `FooUuid` type alias: `pub type FooUuid = TypedUuid<FooKind>;`.
6161///
6262/// ## Examples
@@ -68,26 +68,27 @@ use quote::ToTokens;
6868/// impl_typed_uuid_kinds! {
6969/// kinds = {
7070/// User = {},
71- /// Organization = {},
71+ /// BusinessUnit = {},
7272/// },
7373/// }
7474///
75- /// // This generates empty UserKind and OrganizationKind enums implementing
76- /// // TypedUuidKind, with the tags "user" and "organization " respectively.
75+ /// // This generates empty UserKind and BusinessUnitKind enums implementing
76+ /// // TypedUuidKind, with the tags "user" and "business_unit " respectively.
7777/// // Tags are snake_case versions of type names.
7878/// assert_eq!(UserKind::tag().as_str(), "user");
79- /// assert_eq!(OrganizationKind ::tag().as_str(), "organization ");
79+ /// assert_eq!(BusinessUnitKind ::tag().as_str(), "business_unit ");
8080///
81- /// // The macro also generates UserUuid and OrganizationUuid type aliases.
81+ /// // The macro also generates UserUuid and BusinessUnitUuid type aliases.
8282/// let user_uuid = UserUuid::new_v4();
83- /// let organization_uuid = OrganizationUuid ::new_v4();
83+ /// let business_unit_uuid = BusinessUnitUuid ::new_v4();
8484/// ```
8585///
8686/// * The generated `Kind` types always implement `Clone`, `Copy`, `Debug`,
8787/// `Eq`, and `PartialEq`.
88- /// * The `Kind` types are all empty (uninhabited) enums, which means that
89- /// values for these types cannot be created. (Using empty enums is the
90- /// recommended approach for `newtype-uuid`).
88+ /// * The `Kind` types are all empty enums, also known as *marker* or
89+ /// *uninhabited* enums. This means that values for these types cannot be
90+ /// created. (Using empty enums is the recommended approach for
91+ /// `newtype-uuid`).
9192///
9293/// # Per-kind settings
9394///
@@ -154,14 +155,15 @@ use quote::ToTokens;
154155/// If the `schemars08` global setting is defined, the macro generates JSON
155156/// Schema support for the `Kind` instances using [schemars 0.8].
156157///
157- /// **To enable JSON Schema support, you'll need to turn on `newtype-uuid`'s
158+ /// **To enable JSON Schema support, you'll need to enable `newtype-uuid`'s
158159/// `schemars08` feature.**
159160///
160161/// Within `settings.schemars08`, the options are:
161162///
162163/// - `attrs`: A list of attributes to apply to all generated `JsonSchema`
163- /// implementations. This will often be something like `[#cfg(feature =
164- /// "schemars-feature-name")]]`.
164+ /// implementations. For example, if `schemars` is an optional dependency
165+ /// for the crate where the macro is being invoked, you might specify something
166+ /// like `[#cfg(feature = "schemars")]`.
165167/// - `rust_type`: If defined, adds the `x-rust-type` extension to the schema,
166168/// enabling automatic replacement with [`typify`] and other tools that
167169/// support it. *Optional, defaults to not adding the extension.*
@@ -201,7 +203,7 @@ use quote::ToTokens;
201203/// attrs = [#[cfg(feature = "schemars")]],
202204/// rust_type = {
203205/// crate = "my-crate",
204- /// version = "* ",
206+ /// version = "0.1.0 ",
205207/// path = "my_crate::types",
206208/// },
207209/// },
0 commit comments