Skip to content

Commit

Permalink
Mention features in lib.rs and Variant
Browse files Browse the repository at this point in the history
  • Loading branch information
Bromeon committed Oct 4, 2021
1 parent 971d8fb commit b7f26aa
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
11 changes: 8 additions & 3 deletions gdnative-core/src/core_types/variant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,15 @@ mod serialize;

// TODO: implement Debug, PartialEq, etc.

/// A `Variant` can represent many of godot's core types.
/// A `Variant` can represent all Godot values (core types or `Object` class instances).
///
/// The underlying data can be either stored inline or reference-counted,
/// dependning on the size of the type and whether the it is trivially copyable.
/// The underlying data is either stored inline or reference-counted on the heap,
/// depending on the size of the type and whether the it is trivially copyable.
///
/// If you compile godot-rust with the `serde` feature enabled, you will have
/// access to serialization/deserialization support: the traits `Serializable`
/// and `Deserializable` will be automatically implemented on [`VariantDispatch`]
/// as well as most of the types in [`core_types`].
pub struct Variant(pub(crate) sys::godot_variant);

macro_rules! variant_constructors {
Expand Down
11 changes: 7 additions & 4 deletions gdnative/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
//!
//! Since it is easy to expect containers and other types to allocate a copy of their
//! content when using the `Clone` trait, some types do not implement `Clone` and instead
//! implement [`NewRef`](./trait.NewRef.html) which provides a `new_ref(&self) -> Self` method
//! implement [`NewRef`](object::NewRef) which provides a `new_ref(&self) -> Self` method
//! to create references to the same collection or object.
//!
//! ## Generated API types
Expand All @@ -41,9 +41,12 @@
//!
//! ## Feature flags
//!
//! ### `bindings`
//!
//! *Enabled* by default. Includes the crates.io version of the bindings in the `api` module.
//! * `bindings` -- *enabled* by default. Includes the crates.io version of the bindings in the
//! `api` module. Disable if you want to use a custom Godot version.
//! * `serde` -- *disabled* by default. Enable for `serde` support. See also
//! [`Variant`](core_types::Variant).
//! * `formatted` -- *disabled* by default. Enable if the generated binding source code should
//! be human-readable.
//!
//! [thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html
//! [custom-version]: https://github.com/godot-rust/godot-rust/#other-versions-or-custom-builds
Expand Down

0 comments on commit b7f26aa

Please sign in to comment.