Skip to content

Commit

Permalink
Change Memory type-tags to enums, so they can't be instantiated (empt…
Browse files Browse the repository at this point in the history
…y types)
  • Loading branch information
Bromeon committed Nov 10, 2021
1 parent 75d1590 commit 7cbc5e2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions gdnative-core/src/object/memory.rs
@@ -1,14 +1,13 @@
//! Marker types to express the memory management method of Godot types.
// Note: they are enums to prevent instantiation (empty types)

use crate::object::bounds::MemorySpec;

/// Marker that indicates that a type is manually managed.
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Default)]
pub struct ManuallyManaged;
pub enum ManuallyManaged {}

/// Marker that indicates that a type is reference-counted.
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Default)]
pub struct RefCounted;
pub enum RefCounted {}

/// Trait to parameterize over the memory management markers [`ManuallyManaged`] and [`RefCounted`].
///
Expand Down

0 comments on commit 7cbc5e2

Please sign in to comment.