|
133 | 133 | //!
|
134 | 134 | //! `params`:
|
135 | 135 | //! - `data`:
|
136 |
| -//! - `components` (optional): An array of [fully-qualified type names] of components to fetch. |
| 136 | +//! - `components` (optional): An array of [fully-qualified type names] of components to fetch, |
| 137 | +//! see _below_ example for a query to list all the type names in **your** project. |
137 | 138 | //! - `option` (optional): An array of fully-qualified type names of components to fetch optionally.
|
138 | 139 | //! - `has` (optional): An array of fully-qualified type names of components whose presence will be
|
139 | 140 | //! reported as boolean values.
|
|
142 | 143 | //! on entities in order for them to be included in results.
|
143 | 144 | //! - `without` (optional): An array of fully-qualified type names of components that must *not* be
|
144 | 145 | //! present on entities in order for them to be included in results.
|
145 |
| -//! - `strict` (optional): A flag to enable strict mode which will fail if any one of the |
146 |
| -//! components is not present or can not be reflected. Defaults to false. |
| 146 | +//! - `strict` (optional): A flag to enable strict mode which will fail if any one of the |
| 147 | +//! components is not present or can not be reflected. Defaults to false. |
147 | 148 | //!
|
148 | 149 | //! `result`: An array, each of which is an object containing:
|
149 | 150 | //! - `entity`: The ID of a query-matching entity.
|
|
152 | 153 | //! - `has`: A map associating each type name from `has` to a boolean value indicating whether or not the
|
153 | 154 | //! entity has that component. If `has` was empty or omitted, this key will be omitted in the response.
|
154 | 155 | //!
|
| 156 | +//! |
| 157 | +//! |
155 | 158 | //! ### bevy/spawn
|
156 | 159 | //!
|
157 | 160 | //! Create a new entity with the provided components and return the resulting entity ID.
|
@@ -567,6 +570,26 @@ pub struct RemoteWatchingRequests(Vec<(BrpMessage, RemoteWatchingMethodSystemId)
|
567 | 570 | /// }
|
568 | 571 | /// }
|
569 | 572 | /// ```
|
| 573 | +/// Or, to list all the fully-qualified type paths in **your** project, pass Null to the |
| 574 | +/// `params`. |
| 575 | +/// ```json |
| 576 | +/// { |
| 577 | +/// "jsonrpc": "2.0", |
| 578 | +/// "method": "bevy/list", |
| 579 | +/// "id": 0, |
| 580 | +/// "params": null |
| 581 | +///} |
| 582 | +///``` |
| 583 | +/// |
| 584 | +/// In Rust: |
| 585 | +/// ```ignore |
| 586 | +/// let req = BrpRequest { |
| 587 | +/// jsonrpc: "2.0".to_string(), |
| 588 | +/// method: BRP_LIST_METHOD.to_string(), // All the methods have consts |
| 589 | +/// id: Some(ureq::json!(0)), |
| 590 | +/// params: None, |
| 591 | +/// }; |
| 592 | +/// ``` |
570 | 593 | #[derive(Debug, Serialize, Deserialize, Clone)]
|
571 | 594 | pub struct BrpRequest {
|
572 | 595 | /// This field is mandatory and must be set to `"2.0"` for the request to be accepted.
|
|
0 commit comments