Skip to content

Commit

Permalink
+docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Bromeon committed Nov 24, 2024
1 parent e54a565 commit 305c065
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 0 additions & 1 deletion godot-core/src/obj/dyn_gd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/

use crate::meta;
use crate::meta::ParamType;
use crate::obj::guards::DynGdRef;
use crate::obj::{bounds, AsDyn, Bounds, DynGdMut, Gd, GodotClass, Inherits};
use std::ops;
Expand Down
5 changes: 5 additions & 0 deletions godot-core/src/obj/gd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,11 @@ impl<T: GodotClass> Gd<T> {
}
}

/// Upgrades to a `DynGd<T, D>` pointer, enabling the `D` abstraction.
///
/// The `D` parameter can typically be inferred when there is a single `AsDyn<...>` implementation for `T`. \
/// Otherwise, use it as `gd.into_dyn::<dyn MyTrait>()`.
#[must_use]
pub fn into_dyn<D>(self) -> DynGd<T, D>
where
T: crate::obj::AsDyn<D> + Bounds<Declarer = bounds::DeclUser>,
Expand Down

0 comments on commit 305c065

Please sign in to comment.