summaryrefslogtreecommitdiff
path: root/ecs/src/component.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ecs/src/component.rs')
-rw-r--r--ecs/src/component.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/ecs/src/component.rs b/ecs/src/component.rs
index de4384b..a0ed752 100644
--- a/ecs/src/component.rs
+++ b/ecs/src/component.rs
@@ -99,6 +99,9 @@ pub trait HandleFromEntityComponentRef<'comp>: Sized
type Error: Error;
/// Creates a new handle instance from a [`EntityComponentRef`].
+ ///
+ /// # Errors
+ /// See the implementation's [`Self::Error`] type.
fn from_entity_component_ref(
entity_component_ref: Option<EntityComponentRef<'comp>>,
world: &'comp World,
@@ -306,16 +309,19 @@ pub struct Parts
impl Parts
{
+ #[must_use]
pub fn id(&self) -> Uid
{
self.id
}
+ #[must_use]
pub fn name(&self) -> &'static str
{
self.name
}
+ #[must_use]
pub fn builder() -> PartsBuilder
{
PartsBuilder::default()
@@ -335,12 +341,14 @@ pub struct PartsBuilder
impl PartsBuilder
{
+ #[must_use]
pub fn name(mut self, name: &'static str) -> Self
{
self.name = name;
self
}
+ #[must_use]
pub fn build<Data: 'static>(self, id: Uid, data: Data) -> Parts
{
Parts {