Skip to content

Commit

Permalink
better trait method doc
Browse files Browse the repository at this point in the history
  • Loading branch information
maniwani committed Aug 1, 2022
1 parent e967e06 commit 25a5735
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions crates/bevy_ecs/src/system/system_param.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,18 @@ pub unsafe trait SystemParamState: Send + Sync + 'static {

/// # Safety
///
/// This function must:
/// - return [`WorldAccessLevel::Exclusive`] if [`get_param`](SystemParamFetch::get_param)
/// constructs a [`&mut World`](World).
/// - return [`WorldAccessLevel::Shared`] if
/// [`get_param`](SystemParamFetch::get_param) constructs a [`&World`](World).
/// - **panic** if [`get_param`](SystemParamFetch::get_param) would construct both at the same time.
/// This function must return:
/// - [`WorldAccessLevel::Exclusive`] if [`get_param`](SystemParamFetch::get_param)
/// internally constructs a [`&mut World`](World) (or a type that can make one).
/// - [`WorldAccessLevel::Shared`] if [`get_param`](SystemParamFetch::get_param)
/// internally constructs a [`&World`](World) (or a type that can make one).
/// - [`WorldAccessLevel::None`] otherwise.
///
/// # Panics
///
/// During system construction, [`SystemParam`] tuples and implementations
/// produced by the [`#[derive(SystemParam)`](`derive@super::SystemParam`)
/// macro will panic on invalid combinations that would be undefined behavior.
fn world_access_level() -> WorldAccessLevel;
}

Expand Down

0 comments on commit 25a5735

Please sign in to comment.