Skip to content

Commit

Permalink
MessageId unbounded Copy impl
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob-JB committed Jun 26, 2024
1 parent bad0012 commit 877a1e9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/nevy_messaging/src/serialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ impl<T: Serialize + Send + Sync + 'static, C: Component> MessageIdBuilder<C>

/// the message id for a message `T`,
/// assigned by [MessageSerializationPlugin] and stored as a resource
#[derive(Copy, Resource)]
#[derive(Resource)]
pub struct MessageId<C, T> {
_p: PhantomData<(C, T)>,
message_id: u16,
Expand All @@ -75,6 +75,8 @@ impl<C, T> Clone for MessageId<C, T> {
}
}

impl<C, T> Copy for MessageId<C, T> {}

/// wraps a stream id and ensures that the message protocol isn't broken
pub struct MessageStreamState<C> {
_p: PhantomData<C>,
Expand Down

0 comments on commit 877a1e9

Please sign in to comment.