-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 27fc36f
Showing
91 changed files
with
1,452 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
window.ALL_CRATES = ["gd_props"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="List of all items in this crate"><title>List of all items in this crate</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-9ee3a5e31a2afa3e.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="gd_props" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0 (82e1608df 2023-12-21)" data-channel="1.75.0" data-search-js="search-8fbf244ebcf71464.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../static.files/main-9dd44ab47b99a0fb.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc mod sys"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../gd_props/index.html">gd_props</a><span class="version">0.1.0</span></h2></div><div class="sidebar-elems"><section><ul class="block"><li><a href="#enums">Enums</a></li><li><a href="#traits">Traits</a></li><li><a href="#functions">Functions</a></li><li><a href="#attributes">Attribute Macros</a></li><li><a href="#derives">Derive Macros</a></li></ul></section></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><h1>List of all items</h1><h3 id="enums">Enums</h3><ul class="all-items"><li><a href="errors/enum.GdPropError.html">errors::GdPropError</a></li></ul><h3 id="traits">Traits</h3><ul class="all-items"><li><a href="traits/trait.GdProp.html">traits::GdProp</a></li><li><a href="traits/trait.GdPropExporter.html">traits::GdPropExporter</a></li><li><a href="traits/trait.GdPropLoader.html">traits::GdPropLoader</a></li><li><a href="traits/trait.GdPropSaver.html">traits::GdPropSaver</a></li><li><a href="traits/trait.RefCountedSingleton.html">traits::RefCountedSingleton</a></li></ul><h3 id="attributes">Attribute Macros</h3><ul class="all-items"><li><a href="attr.gd_props_plugin.html">gd_props_plugin</a></li></ul><h3 id="derives">Derive Macros</h3><ul class="all-items"><li><a href="derive.GdProp.html">GdProp</a></li></ul><h3 id="functions">Functions</h3><ul class="all-items"><li><a href="serde_gd/ext/fn.deserialize.html">serde_gd::ext::deserialize</a></li><li><a href="serde_gd/ext/fn.serialize.html">serde_gd::ext::serialize</a></li><li><a href="serde_gd/ext_array/fn.deserialize.html">serde_gd::ext_array::deserialize</a></li><li><a href="serde_gd/ext_array/fn.serialize.html">serde_gd::ext_array::serialize</a></li><li><a href="serde_gd/ext_hashmap/fn.deserialize.html">serde_gd::ext_hashmap::deserialize</a></li><li><a href="serde_gd/ext_hashmap/fn.serialize.html">serde_gd::ext_hashmap::serialize</a></li><li><a href="serde_gd/ext_option/fn.deserialize.html">serde_gd::ext_option::deserialize</a></li><li><a href="serde_gd/ext_option/fn.serialize.html">serde_gd::ext_option::serialize</a></li><li><a href="serde_gd/gd/fn.deserialize.html">serde_gd::gd::deserialize</a></li><li><a href="serde_gd/gd/fn.serialize.html">serde_gd::gd::serialize</a></li><li><a href="serde_gd/gd_array/fn.deserialize.html">serde_gd::gd_array::deserialize</a></li><li><a href="serde_gd/gd_array/fn.serialize.html">serde_gd::gd_array::serialize</a></li><li><a href="serde_gd/gd_hashmap/fn.deserialize.html">serde_gd::gd_hashmap::deserialize</a></li><li><a href="serde_gd/gd_hashmap/fn.serialize.html">serde_gd::gd_hashmap::serialize</a></li><li><a href="serde_gd/gd_option/fn.deserialize.html">serde_gd::gd_option::deserialize</a></li><li><a href="serde_gd/gd_option/fn.serialize.html">serde_gd::gd_option::serialize</a></li></ul></section></div></main></body></html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Implement GodotClasses necessary for `.gdbin` and `.gdron` files handling within Godot"><title>gd_props_plugin in gd_props - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-9ee3a5e31a2afa3e.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="gd_props" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0 (82e1608df 2023-12-21)" data-channel="1.75.0" data-search-js="search-8fbf244ebcf71464.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-9dd44ab47b99a0fb.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc attr"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../gd_props/index.html">gd_props</a><span class="version">0.1.0</span></h2></div><div class="sidebar-elems"></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Attribute Macro <a href="index.html">gd_props</a>::<wbr><a class="attr" href="#">gd_props_plugin</a><button id="copy-path" title="Copy item path to clipboard"><img src="../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><pre class="rust item-decl"><code>#[gd_props_plugin]</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Implement GodotClasses necessary for <code>.gdbin</code> and <code>.gdron</code> files handling within Godot</p> | ||
<p>This single macro is used to implement four different, intertwined <a href="godot::obj::GodotClass"><code>GodotClass</code></a> | ||
structs with all necessary implementations:</p> | ||
<ul> | ||
<li><a href="godot::engine::ResourceFormatLoader"><code>ResourceFormatLoader</code></a> and <a href="godot::engine::ResourceFormatSaver"><code>ResourceFormatSaver</code></a>: used to | ||
load and save <a href="derive.GdProp.html" title="derive gd_props::GdProp"><code>GdProp</code></a>-deriving resources to <code>.gdbin</code> and <code>.gdron</code> formats,</li> | ||
<li><a href="godot::engine::EditorPlugin"><code>EditorPlugin</code></a> and <a href="godot::engine::EditorExportPlugin"><code>EditorExportPlugin</code></a> which handle | ||
exporting <code>.gdbin</code> and <code>.gdron</code> format files. <code>.gdron</code> files are transformed into more compact and faster <code>.gdbin</code> format | ||
during export.</li> | ||
</ul> | ||
<p>Identifiers will be generated based on provided struct <code>Identifier</code>, with the visibility marker provided, either <code>pub</code> or <code>pub(crate)</code>:</p> | ||
<ul> | ||
<li><code>EditorPlugin</code>: <code>Identifier</code>,</li> | ||
<li><code>EditorExportPlugin</code>: <code>IdentifierExporter</code>,</li> | ||
<li><code>ResourceFormatSaver</code>: <code>IdentifierSaver</code>,</li> | ||
<li><code>ResourceFormatLoader</code>: <code>IdentifierLoader</code>.</li> | ||
</ul> | ||
<h3 id="register-gdprop-resources"><a href="#register-gdprop-resources">Register <code>GdProp</code> resources</a></h3> | ||
<p>Every resource that should be saveable/loadable/exportable as <code>.gdbin</code>/<code>.gdron</code> file needs to be provided in helper | ||
<code>#[register]</code> macro attribute, as seen in example below. Multiple <code>#[register]</code> helper macros with different identifiers can be provided | ||
for code readability.</p> | ||
<h3 id="setup"><a href="#setup">Setup</a></h3> | ||
<p>Created plugins don’t need further setup: as they are created, they will be registered and used by <code>Godot</code> automatically | ||
during export.</p> | ||
<p>Loader and Saver need registering in your <a href="godot::init::gdextension"><code>#[gdextension]</code></a> implementation. It is recommended to | ||
use provided associated functions: <a href="gd_props_defs::traits::GdPropSaver::register_saver"><code>register_saver</code></a> and | ||
<a href="gd_props_defs::traits::GdPropLoader::register_loader"><code>register_loader</code></a> - for implementation details see their documentation.</p> | ||
<h3 id="example"><a href="#example">Example</a></h3> | ||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>godot::prelude::<span class="kw-2">*</span>; | ||
<span class="kw">use </span>gd_props::gd_props_plugin; | ||
|
||
<span class="comment">// Macro creates four different GodotClasses and registers two resources implementing `GdProp` | ||
</span><span class="attr">#[gd_props_plugin] | ||
#[register(MyResource, MyOtherResource)] | ||
</span><span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">struct </span>MyPropPlugin; | ||
|
||
<span class="comment">// Plugin and Exporter are only available in-editor for exporting resources. | ||
</span><span class="macro">assert_eq!</span>(MyPropPlugin::INIT_LEVEL, InitLevel::Editor); | ||
<span class="macro">assert_eq!</span>(MyPropPluginExporter::INIT_LEVEL, InitLevel::Editor); | ||
|
||
<span class="comment">// Loader and Saver are available in scenes for loading/saving registered resources. | ||
</span><span class="macro">assert_eq!</span>(MyPropPluginSaver::INIT_LEVEL, InitLevel::Scene); | ||
<span class="macro">assert_eq!</span>(MyPropPluginLoader::INIT_LEVEL, InitLevel::Scene);</code></pre></div> | ||
</div></details></section></div></main></body></html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Macro used to implement GdProp trait, which makes a rust-defined Godot Resource saveable and loadable to and from `.gdron` and `.gdbin` formats."><title>GdProp in gd_props - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-9ee3a5e31a2afa3e.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="gd_props" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0 (82e1608df 2023-12-21)" data-channel="1.75.0" data-search-js="search-8fbf244ebcf71464.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-9dd44ab47b99a0fb.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc derive"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../gd_props/index.html">gd_props</a><span class="version">0.1.0</span></h2></div><div class="sidebar-elems"></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Derive Macro <a href="index.html">gd_props</a>::<wbr><a class="derive" href="#">GdProp</a><button id="copy-path" title="Copy item path to clipboard"><img src="../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><pre class="rust item-decl"><code>#[derive(GdProp)]</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Macro used to implement <a href="gd_props_defs::traits::GdProp">GdProp</a> trait, which makes a rust-defined Godot <a href="godot::engine::Resource">Resource</a> | ||
saveable and loadable to and from <code>.gdron</code> and <code>.gdbin</code> formats.</p> | ||
<p>Provides compatibility with [GdPropSaver] and [GdPropLoader] deriving structs.</p> | ||
<h3 id="example"><a href="#example">Example</a></h3> | ||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>godot::prelude::GodotClass; | ||
<span class="kw">use </span>gd_props::GdProp; | ||
<span class="kw">use </span>serde::{Serialize, Deserialize}; | ||
|
||
<span class="attr">#[derive(GodotClass, Serialize, Deserialize, GdProp)] | ||
#[class(init, base=Resource)] | ||
</span><span class="kw">struct </span>MyResource {}</code></pre></div> | ||
</div></details></section></div></main></body></html> |
Oops, something went wrong.