rakata_generics/lib.rs
1//! Higher-level typed wrappers around GFF-backed game resources.
2//!
3//! This crate hosts strongly typed structures such as `ARE`, `UTC`, and
4//! related conversion helpers.
5//!
6//! ## Clone discipline in `to_gff()` methods
7//!
8//! Serialization methods take `&self` and must hand owned data to
9//! `GffValue` variants (which store owned `String`, `GffLocalizedString`,
10//! `Vec<_>`, etc.). Cloning is necessary because `&self` cannot move
11//! fields out. This is a uniform pattern across all typed generics and
12//! is not flagged per-clone.
13
14#![forbid(unsafe_code)]
15#![warn(clippy::as_conversions)]
16#![deny(missing_docs)]
17
18mod gff_helpers;
19
20/// Current implementation status for this crate.
21pub const PORT_STATUS: &str = "are-utc-uti-utp-utd-utm-uts-utt-utw-bootstrap";
22
23/// Typed ARE (`.are`) model and conversion helpers.
24pub mod are;
25/// Resolver-backed decoded views over typed generic models.
26pub mod decoded;
27/// Typed DLG (`.dlg`) model and conversion helpers.
28pub mod dlg;
29/// Typed GIT (`.git`) model and conversion helpers.
30pub mod git;
31/// Typed IFO (`.ifo`) model and conversion helpers.
32pub mod ifo;
33/// Shared typed components reused across generic wrappers.
34pub mod shared;
35/// Typed UTC (`.utc`) model and conversion helpers.
36pub mod utc;
37/// Typed UTD (`.utd`) model and conversion helpers.
38pub mod utd;
39/// Typed UTE (`.ute`) model and conversion helpers.
40pub mod ute;
41/// Typed UTI (`.uti`) model and conversion helpers.
42pub mod uti;
43/// Typed UTM (`.utm`) model and conversion helpers.
44pub mod utm;
45/// Typed UTP (`.utp`) model and conversion helpers.
46pub mod utp;
47/// Typed UTS (`.uts`) model and conversion helpers.
48pub mod uts;
49/// Typed UTT (`.utt`) model and conversion helpers.
50pub mod utt;
51/// Typed UTW (`.utw`) model and conversion helpers.
52pub mod utw;
53
54/// Reads typed ARE data from a reader.
55pub use are::read_are;
56/// Reads typed ARE data from bytes.
57pub use are::read_are_from_bytes;
58/// Writes typed ARE data to a writer.
59pub use are::write_are;
60/// Writes typed ARE data to bytes.
61pub use are::write_are_to_vec;
62/// Typed ARE model.
63pub use are::Are;
64/// Errors produced while reading/writing typed ARE data.
65pub use are::AreError;
66/// Typed nested map model for ARE resources.
67pub use are::AreMap;
68/// Typed mini-game model for ARE resources.
69pub use are::AreMiniGame;
70/// Typed mini-game enemy model for ARE resources.
71pub use are::AreMiniGameEnemy;
72/// Typed mini-game model entry for ARE resources.
73pub use are::AreMiniGameModel;
74/// Typed mini-game mouse settings for ARE resources.
75pub use are::AreMiniGameMouse;
76/// Typed mini-game obstacle model for ARE resources.
77pub use are::AreMiniGameObstacle;
78/// Typed mini-game player model for ARE resources.
79pub use are::AreMiniGamePlayer;
80/// Typed nested room model for ARE resources.
81pub use are::AreRoom;
82/// Categorical filter for [`UtcSnapshot::has_class`].
83pub use decoded::ClassKindFilter;
84/// One decoded UTC class entry surfaced via [`UtcSnapshot::classes`].
85pub use decoded::DecodedClass;
86/// One decoded UTC feat entry surfaced via [`UtcSnapshot::feats`].
87pub use decoded::DecodedFeat;
88/// One decoded item-property entry surfaced via [`UtiProjection`] /
89/// [`UtiSnapshot`].
90pub use decoded::DecodedProperty;
91/// One decoded UTC special-ability entry surfaced via
92/// [`UtcSnapshot::special_abilities`].
93pub use decoded::DecodedSpecialAbility;
94/// Family / aggregation filter for [`UtcSnapshot::has_feat`].
95pub use decoded::FeatKindFilter;
96/// Categorical filter for [`UtiSnapshot::has_property_kind`].
97pub use decoded::PropertyKindFilter;
98/// File-native projection of a [`Utc`] (wraps the source UTC ready to
99/// feed one or more per-scope snapshots).
100pub use decoded::UtcProjection;
101/// Per-scope snapshot of a [`Utc`] built from a [`UtcProjection`] and
102/// a 2DA cache; queries read from cached resolutions and take `&self`.
103pub use decoded::UtcSnapshot;
104/// File-native projection of a [`Uti`] (typed-variant dispatch only,
105/// no per-scope resolution).
106pub use decoded::UtiProjection;
107/// Per-scope snapshot of a [`Uti`] built from a [`UtiProjection`] and
108/// a 2DA cache; queries read from cached resolutions and take `&self`.
109pub use decoded::UtiSnapshot;
110/// Reads typed DLG data from a reader.
111pub use dlg::read_dlg;
112/// Reads typed DLG data from bytes.
113pub use dlg::read_dlg_from_bytes;
114/// Writes typed DLG data to a writer.
115pub use dlg::write_dlg;
116/// Writes typed DLG data to bytes.
117pub use dlg::write_dlg_to_vec;
118/// Typed DLG model.
119pub use dlg::Dlg;
120/// Typed DLG animation entry model.
121pub use dlg::DlgAnimation;
122/// Errors produced while reading/writing typed DLG data.
123pub use dlg::DlgError;
124/// Typed DLG link model.
125pub use dlg::DlgLink;
126/// Typed DLG dialogue node model.
127pub use dlg::DlgNode;
128/// Typed DLG cutscene stunt model.
129pub use dlg::DlgStunt;
130/// Reads typed GIT data from a reader.
131pub use git::read_git;
132/// Reads typed GIT data from bytes.
133pub use git::read_git_from_bytes;
134/// Writes typed GIT data to a writer.
135pub use git::write_git;
136/// Writes typed GIT data to bytes.
137pub use git::write_git_to_vec;
138/// Typed GIT model.
139pub use git::Git;
140/// Typed GIT area-of-effect instance model.
141pub use git::GitAreaEffect;
142/// Typed GIT area properties model.
143pub use git::GitAreaProperties;
144/// Typed GIT camera model.
145pub use git::GitCamera;
146/// Typed GIT creature instance model.
147pub use git::GitCreature;
148/// Typed GIT door instance model.
149pub use git::GitDoor;
150/// Typed GIT encounter instance model.
151pub use git::GitEncounter;
152/// Typed GIT encounter geometry point model.
153pub use git::GitEncounterPoint;
154/// Errors produced while reading/writing typed GIT data.
155pub use git::GitError;
156/// Typed GIT item instance model.
157pub use git::GitItem;
158/// Typed GIT placeable instance model.
159pub use git::GitPlaceable;
160/// Typed GIT sound instance model.
161pub use git::GitSound;
162/// Typed GIT spawn point model.
163pub use git::GitSpawnPoint;
164/// Typed GIT store instance model.
165pub use git::GitStore;
166/// Typed GIT trigger instance model.
167pub use git::GitTrigger;
168/// Typed GIT waypoint instance model.
169pub use git::GitWaypoint;
170/// Reads typed IFO data from a reader.
171pub use ifo::read_ifo;
172/// Reads typed IFO data from bytes.
173pub use ifo::read_ifo_from_bytes;
174/// Writes typed IFO data to a writer.
175pub use ifo::write_ifo;
176/// Writes typed IFO data to bytes.
177pub use ifo::write_ifo_to_vec;
178/// Typed IFO model.
179pub use ifo::Ifo;
180/// Typed IFO area list entry model.
181pub use ifo::IfoArea;
182/// Typed IFO cutscene list entry model.
183pub use ifo::IfoCutScene;
184/// Errors produced while reading/writing typed IFO data.
185pub use ifo::IfoError;
186/// Typed IFO expansion list entry model.
187pub use ifo::IfoExpansion;
188/// Typed IFO player list entry model.
189pub use ifo::IfoPlayer;
190/// Typed IFO token entry model.
191pub use ifo::IfoToken;
192/// Shared script hook bundle for door/placeable trap-related scripts.
193pub use shared::CommonTrapScripts;
194/// Typed GIT trigger geometry point model.
195pub use shared::GitTriggerPoint;
196/// Shared inventory grid/repository position.
197pub use shared::InventoryGridPosition;
198/// Shared trap settings block used by multiple generic wrappers.
199pub use shared::TrapSettings;
200/// Reads typed UTC data from a reader.
201pub use utc::read_utc;
202/// Reads typed UTC data from bytes.
203pub use utc::read_utc_from_bytes;
204/// Writes typed UTC data to a writer.
205pub use utc::write_utc;
206/// Writes typed UTC data to bytes.
207pub use utc::write_utc_to_vec;
208/// Typed UTC model.
209pub use utc::Utc;
210/// Typed UTC class entry model.
211pub use utc::UtcClass;
212/// Errors produced while reading/writing typed UTC data.
213pub use utc::UtcError;
214/// Typed UTC skill set model.
215pub use utc::UtcSkills;
216/// Reads typed UTD data from a reader.
217pub use utd::read_utd;
218/// Reads typed UTD data from bytes.
219pub use utd::read_utd_from_bytes;
220/// Writes typed UTD data to a writer.
221pub use utd::write_utd;
222/// Writes typed UTD data to bytes.
223pub use utd::write_utd_to_vec;
224/// Typed UTD model.
225pub use utd::Utd;
226/// Errors produced while reading/writing typed UTD data.
227pub use utd::UtdError;
228/// Reads typed UTE data from a reader.
229pub use ute::read_ute;
230/// Reads typed UTE data from bytes.
231pub use ute::read_ute_from_bytes;
232/// Writes typed UTE data to a writer.
233pub use ute::write_ute;
234/// Writes typed UTE data to bytes.
235pub use ute::write_ute_to_vec;
236/// Typed UTE model.
237pub use ute::Ute;
238/// Typed UTE area list entry model.
239pub use ute::UteAreaEntry;
240/// Typed UTE creature entry model.
241pub use ute::UteCreature;
242/// Errors produced while reading/writing typed UTE data.
243pub use ute::UteError;
244/// Typed UTE geometry vertex model.
245pub use ute::UteGeometryVertex;
246/// Typed UTE spawn entry model.
247pub use ute::UteSpawnEntry;
248/// Typed UTE spawn point model.
249pub use ute::UteSpawnPoint;
250/// Reads typed UTI data from a reader.
251pub use uti::read_uti;
252/// Reads typed UTI data from bytes.
253pub use uti::read_uti_from_bytes;
254/// Writes typed UTI data to a writer.
255pub use uti::write_uti;
256/// Writes typed UTI data to bytes.
257pub use uti::write_uti_to_vec;
258/// Typed UTI model.
259pub use uti::Uti;
260/// Errors produced while reading/writing typed UTI data.
261pub use uti::UtiError;
262/// Typed UTI property entry model.
263pub use uti::UtiProperty;
264/// Reads typed UTM data from a reader.
265pub use utm::read_utm;
266/// Reads typed UTM data from bytes.
267pub use utm::read_utm_from_bytes;
268/// Writes typed UTM data to a writer.
269pub use utm::write_utm;
270/// Writes typed UTM data to bytes.
271pub use utm::write_utm_to_vec;
272/// Typed UTM model.
273pub use utm::Utm;
274/// Errors produced while reading/writing typed UTM data.
275pub use utm::UtmError;
276/// Typed UTM inventory entry model.
277pub use utm::UtmInventoryItem;
278/// Reads typed UTP data from a reader.
279pub use utp::read_utp;
280/// Reads typed UTP data from bytes.
281pub use utp::read_utp_from_bytes;
282/// Writes typed UTP data to a writer.
283pub use utp::write_utp;
284/// Writes typed UTP data to bytes.
285pub use utp::write_utp_to_vec;
286/// Typed UTP model.
287pub use utp::Utp;
288/// Errors produced while reading/writing typed UTP data.
289pub use utp::UtpError;
290/// Typed UTP inventory entry model.
291pub use utp::UtpInventoryItem;
292/// Reads typed UTS data from a reader.
293pub use uts::read_uts;
294/// Reads typed UTS data from bytes.
295pub use uts::read_uts_from_bytes;
296/// Writes typed UTS data to a writer.
297pub use uts::write_uts;
298/// Writes typed UTS data to bytes.
299pub use uts::write_uts_to_vec;
300/// Typed UTS model.
301pub use uts::Uts;
302/// Errors produced while reading/writing typed UTS data.
303pub use uts::UtsError;
304/// Typed UTS sound entry model.
305pub use uts::UtsSound;
306/// Reads typed UTT data from a reader.
307pub use utt::read_utt;
308/// Reads typed UTT data from bytes.
309pub use utt::read_utt_from_bytes;
310/// Writes typed UTT data to a writer.
311pub use utt::write_utt;
312/// Writes typed UTT data to bytes.
313pub use utt::write_utt_to_vec;
314/// Typed UTT model.
315pub use utt::Utt;
316/// Errors produced while reading/writing typed UTT data.
317pub use utt::UttError;
318/// Reads typed UTW data from a reader.
319pub use utw::read_utw;
320/// Reads typed UTW data from bytes.
321pub use utw::read_utw_from_bytes;
322/// Writes typed UTW data to a writer.
323pub use utw::write_utw;
324/// Writes typed UTW data to bytes.
325pub use utw::write_utw_to_vec;
326/// Typed UTW model.
327pub use utw::Utw;
328/// Errors produced while reading/writing typed UTW data.
329pub use utw::UtwError;