Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
JieningYu committed Aug 26, 2023
1 parent f676f2a commit abe59fe
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/src/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ impl ComponentsBuilder {
}

/// Enable nbt reading and writing feature for the instance.
pub fn nbt_rw(mut self) -> Self {
pub fn nbt_storing(mut self) -> Self {
self.inner
.register(nbt_save_event_comp_id(), nbt_event_comp());
self.inner
Expand Down Expand Up @@ -354,6 +354,11 @@ static NBT_SAVE_ID: once_cell::sync::Lazy<crate::Id> =
static NBT_READ_ID: once_cell::sync::Lazy<crate::Id> =
once_cell::sync::Lazy::new(nbt_read_event_comp_id);

/// Represents a component that able to be stored
/// by nbt, through [`crate::nbt::Update`] trait.
///
/// The `1` field is the component id which is used
/// to be registered into components.
pub struct Saved<T>(pub T, pub crate::Id)
where
T: Attach + crate::nbt::Update + 'static;
Expand Down

0 comments on commit abe59fe

Please sign in to comment.