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/// Typed DLG (`.dlg`) model and conversion helpers.
26pub mod dlg;
27/// Typed GIT (`.git`) model and conversion helpers.
28pub mod git;
29/// Typed IFO (`.ifo`) model and conversion helpers.
30pub mod ifo;
31/// Shared typed components reused across generic wrappers.
32pub mod shared;
33/// Typed UTC (`.utc`) model and conversion helpers.
34pub mod utc;
35/// Typed UTD (`.utd`) model and conversion helpers.
36pub mod utd;
37/// Typed UTE (`.ute`) model and conversion helpers.
38pub mod ute;
39/// Typed UTI (`.uti`) model and conversion helpers.
40pub mod uti;
41/// Typed UTM (`.utm`) model and conversion helpers.
42pub mod utm;
43/// Typed UTP (`.utp`) model and conversion helpers.
44pub mod utp;
45/// Typed UTS (`.uts`) model and conversion helpers.
46pub mod uts;
47/// Typed UTT (`.utt`) model and conversion helpers.
48pub mod utt;
49/// Typed UTW (`.utw`) model and conversion helpers.
50pub mod utw;
51
52/// Reads typed ARE data from a reader.
53pub use are::read_are;
54/// Reads typed ARE data from bytes.
55pub use are::read_are_from_bytes;
56/// Writes typed ARE data to a writer.
57pub use are::write_are;
58/// Writes typed ARE data to bytes.
59pub use are::write_are_to_vec;
60/// Typed ARE model.
61pub use are::Are;
62/// Errors produced while reading/writing typed ARE data.
63pub use are::AreError;
64/// Typed nested map model for ARE resources.
65pub use are::AreMap;
66/// Typed mini-game model for ARE resources.
67pub use are::AreMiniGame;
68/// Typed mini-game enemy model for ARE resources.
69pub use are::AreMiniGameEnemy;
70/// Typed mini-game model entry for ARE resources.
71pub use are::AreMiniGameModel;
72/// Typed mini-game mouse settings for ARE resources.
73pub use are::AreMiniGameMouse;
74/// Typed mini-game obstacle model for ARE resources.
75pub use are::AreMiniGameObstacle;
76/// Typed mini-game player model for ARE resources.
77pub use are::AreMiniGamePlayer;
78/// Typed nested room model for ARE resources.
79pub use are::AreRoom;
80/// Reads typed DLG data from a reader.
81pub use dlg::read_dlg;
82/// Reads typed DLG data from bytes.
83pub use dlg::read_dlg_from_bytes;
84/// Writes typed DLG data to a writer.
85pub use dlg::write_dlg;
86/// Writes typed DLG data to bytes.
87pub use dlg::write_dlg_to_vec;
88/// Typed DLG model.
89pub use dlg::Dlg;
90/// Typed DLG animation entry model.
91pub use dlg::DlgAnimation;
92/// Errors produced while reading/writing typed DLG data.
93pub use dlg::DlgError;
94/// Typed DLG link model.
95pub use dlg::DlgLink;
96/// Typed DLG dialogue node model.
97pub use dlg::DlgNode;
98/// Typed DLG cutscene stunt model.
99pub use dlg::DlgStunt;
100/// Reads typed GIT data from a reader.
101pub use git::read_git;
102/// Reads typed GIT data from bytes.
103pub use git::read_git_from_bytes;
104/// Writes typed GIT data to a writer.
105pub use git::write_git;
106/// Writes typed GIT data to bytes.
107pub use git::write_git_to_vec;
108/// Typed GIT model.
109pub use git::Git;
110/// Typed GIT area-of-effect instance model.
111pub use git::GitAreaEffect;
112/// Typed GIT area properties model.
113pub use git::GitAreaProperties;
114/// Typed GIT camera model.
115pub use git::GitCamera;
116/// Typed GIT creature instance model.
117pub use git::GitCreature;
118/// Typed GIT door instance model.
119pub use git::GitDoor;
120/// Typed GIT encounter instance model.
121pub use git::GitEncounter;
122/// Typed GIT encounter geometry point model.
123pub use git::GitEncounterPoint;
124/// Errors produced while reading/writing typed GIT data.
125pub use git::GitError;
126/// Typed GIT item instance model.
127pub use git::GitItem;
128/// Typed GIT placeable instance model.
129pub use git::GitPlaceable;
130/// Typed GIT sound instance model.
131pub use git::GitSound;
132/// Typed GIT spawn point model.
133pub use git::GitSpawnPoint;
134/// Typed GIT store instance model.
135pub use git::GitStore;
136/// Typed GIT trigger instance model.
137pub use git::GitTrigger;
138/// Typed GIT waypoint instance model.
139pub use git::GitWaypoint;
140/// Reads typed IFO data from a reader.
141pub use ifo::read_ifo;
142/// Reads typed IFO data from bytes.
143pub use ifo::read_ifo_from_bytes;
144/// Writes typed IFO data to a writer.
145pub use ifo::write_ifo;
146/// Writes typed IFO data to bytes.
147pub use ifo::write_ifo_to_vec;
148/// Typed IFO model.
149pub use ifo::Ifo;
150/// Typed IFO area list entry model.
151pub use ifo::IfoArea;
152/// Typed IFO cutscene list entry model.
153pub use ifo::IfoCutScene;
154/// Errors produced while reading/writing typed IFO data.
155pub use ifo::IfoError;
156/// Typed IFO expansion list entry model.
157pub use ifo::IfoExpansion;
158/// Typed IFO player list entry model.
159pub use ifo::IfoPlayer;
160/// Typed IFO token entry model.
161pub use ifo::IfoToken;
162/// Shared script hook bundle for door/placeable trap-related scripts.
163pub use shared::CommonTrapScripts;
164/// Typed GIT trigger geometry point model.
165pub use shared::GitTriggerPoint;
166/// Shared inventory grid/repository position.
167pub use shared::InventoryGridPosition;
168/// Shared trap settings block used by multiple generic wrappers.
169pub use shared::TrapSettings;
170/// Reads typed UTC data from a reader.
171pub use utc::read_utc;
172/// Reads typed UTC data from bytes.
173pub use utc::read_utc_from_bytes;
174/// Writes typed UTC data to a writer.
175pub use utc::write_utc;
176/// Writes typed UTC data to bytes.
177pub use utc::write_utc_to_vec;
178/// Typed UTC model.
179pub use utc::Utc;
180/// Typed UTC class entry model.
181pub use utc::UtcClass;
182/// Errors produced while reading/writing typed UTC data.
183pub use utc::UtcError;
184/// Typed UTC skill set model.
185pub use utc::UtcSkills;
186/// Reads typed UTD data from a reader.
187pub use utd::read_utd;
188/// Reads typed UTD data from bytes.
189pub use utd::read_utd_from_bytes;
190/// Writes typed UTD data to a writer.
191pub use utd::write_utd;
192/// Writes typed UTD data to bytes.
193pub use utd::write_utd_to_vec;
194/// Typed UTD model.
195pub use utd::Utd;
196/// Errors produced while reading/writing typed UTD data.
197pub use utd::UtdError;
198/// Reads typed UTE data from a reader.
199pub use ute::read_ute;
200/// Reads typed UTE data from bytes.
201pub use ute::read_ute_from_bytes;
202/// Writes typed UTE data to a writer.
203pub use ute::write_ute;
204/// Writes typed UTE data to bytes.
205pub use ute::write_ute_to_vec;
206/// Typed UTE model.
207pub use ute::Ute;
208/// Typed UTE area list entry model.
209pub use ute::UteAreaEntry;
210/// Typed UTE creature entry model.
211pub use ute::UteCreature;
212/// Errors produced while reading/writing typed UTE data.
213pub use ute::UteError;
214/// Typed UTE geometry vertex model.
215pub use ute::UteGeometryVertex;
216/// Typed UTE spawn entry model.
217pub use ute::UteSpawnEntry;
218/// Typed UTE spawn point model.
219pub use ute::UteSpawnPoint;
220/// Reads typed UTI data from a reader.
221pub use uti::read_uti;
222/// Reads typed UTI data from bytes.
223pub use uti::read_uti_from_bytes;
224/// Writes typed UTI data to a writer.
225pub use uti::write_uti;
226/// Writes typed UTI data to bytes.
227pub use uti::write_uti_to_vec;
228/// Typed UTI model.
229pub use uti::Uti;
230/// Errors produced while reading/writing typed UTI data.
231pub use uti::UtiError;
232/// Typed UTI property entry model.
233pub use uti::UtiProperty;
234/// Reads typed UTM data from a reader.
235pub use utm::read_utm;
236/// Reads typed UTM data from bytes.
237pub use utm::read_utm_from_bytes;
238/// Writes typed UTM data to a writer.
239pub use utm::write_utm;
240/// Writes typed UTM data to bytes.
241pub use utm::write_utm_to_vec;
242/// Typed UTM model.
243pub use utm::Utm;
244/// Errors produced while reading/writing typed UTM data.
245pub use utm::UtmError;
246/// Typed UTM inventory entry model.
247pub use utm::UtmInventoryItem;
248/// Reads typed UTP data from a reader.
249pub use utp::read_utp;
250/// Reads typed UTP data from bytes.
251pub use utp::read_utp_from_bytes;
252/// Writes typed UTP data to a writer.
253pub use utp::write_utp;
254/// Writes typed UTP data to bytes.
255pub use utp::write_utp_to_vec;
256/// Typed UTP model.
257pub use utp::Utp;
258/// Errors produced while reading/writing typed UTP data.
259pub use utp::UtpError;
260/// Typed UTP inventory entry model.
261pub use utp::UtpInventoryItem;
262/// Reads typed UTS data from a reader.
263pub use uts::read_uts;
264/// Reads typed UTS data from bytes.
265pub use uts::read_uts_from_bytes;
266/// Writes typed UTS data to a writer.
267pub use uts::write_uts;
268/// Writes typed UTS data to bytes.
269pub use uts::write_uts_to_vec;
270/// Typed UTS model.
271pub use uts::Uts;
272/// Errors produced while reading/writing typed UTS data.
273pub use uts::UtsError;
274/// Typed UTS sound entry model.
275pub use uts::UtsSound;
276/// Reads typed UTT data from a reader.
277pub use utt::read_utt;
278/// Reads typed UTT data from bytes.
279pub use utt::read_utt_from_bytes;
280/// Writes typed UTT data to a writer.
281pub use utt::write_utt;
282/// Writes typed UTT data to bytes.
283pub use utt::write_utt_to_vec;
284/// Typed UTT model.
285pub use utt::Utt;
286/// Errors produced while reading/writing typed UTT data.
287pub use utt::UttError;
288/// Reads typed UTW data from a reader.
289pub use utw::read_utw;
290/// Reads typed UTW data from bytes.
291pub use utw::read_utw_from_bytes;
292/// Writes typed UTW data to a writer.
293pub use utw::write_utw;
294/// Writes typed UTW data to bytes.
295pub use utw::write_utw_to_vec;
296/// Typed UTW model.
297pub use utw::Utw;
298/// Errors produced while reading/writing typed UTW data.
299pub use utw::UtwError;