Remove volatile warning from TypeBuilder API.
This commit is contained in:
parent
4304da7a47
commit
f7c8238613
@ -8,6 +8,7 @@ Enhancements
|
|||||||
------------
|
------------
|
||||||
|
|
||||||
* `CallableFunction` is exported under `internals`.
|
* `CallableFunction` is exported under `internals`.
|
||||||
|
* The `TypeBuilder` type and `CustomType` trait are no longer marked as volatile.
|
||||||
|
|
||||||
|
|
||||||
Version 1.11.0
|
Version 1.11.0
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
//! Trait to build a custom type for use with [`Engine`].
|
//! Trait to build a custom type for use with [`Engine`].
|
||||||
#![allow(deprecated)]
|
|
||||||
|
|
||||||
use crate::{types::dynamic::Variant, Engine, Identifier, RegisterNativeFunction};
|
use crate::{types::dynamic::Variant, Engine, Identifier, RegisterNativeFunction};
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
#[cfg(feature = "no_std")]
|
#[cfg(feature = "no_std")]
|
||||||
@ -12,10 +10,6 @@ use crate::func::register::Mut;
|
|||||||
/// Trait to build the API of a custom type for use with an [`Engine`]
|
/// Trait to build the API of a custom type for use with an [`Engine`]
|
||||||
/// (i.e. register the type and its getters, setters, methods, etc.).
|
/// (i.e. register the type and its getters, setters, methods, etc.).
|
||||||
///
|
///
|
||||||
/// # WARNING - Volatile Trait
|
|
||||||
///
|
|
||||||
/// This API is volatile and may change in the future.
|
|
||||||
///
|
|
||||||
/// # Example
|
/// # Example
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
@ -66,7 +60,6 @@ use crate::func::register::Mut;
|
|||||||
/// # Ok(())
|
/// # Ok(())
|
||||||
/// # }
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
#[deprecated = "This trait is NOT deprecated, but it is considered volatile and may change in the future."]
|
|
||||||
pub trait CustomType: Variant + Clone {
|
pub trait CustomType: Variant + Clone {
|
||||||
/// Builds the custom type for use with the [`Engine`].
|
/// Builds the custom type for use with the [`Engine`].
|
||||||
///
|
///
|
||||||
@ -78,10 +71,6 @@ impl Engine {
|
|||||||
/// Build the API of a custom type for use with the [`Engine`].
|
/// Build the API of a custom type for use with the [`Engine`].
|
||||||
///
|
///
|
||||||
/// The custom type must implement [`CustomType`].
|
/// The custom type must implement [`CustomType`].
|
||||||
///
|
|
||||||
/// # WARNING - Unstable API
|
|
||||||
///
|
|
||||||
/// This API is volatile and may change in the future.
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn build_type<T: CustomType>(&mut self) -> &mut Self {
|
pub fn build_type<T: CustomType>(&mut self) -> &mut Self {
|
||||||
T::build(TypeBuilder::new(self));
|
T::build(TypeBuilder::new(self));
|
||||||
@ -99,11 +88,6 @@ impl Engine {
|
|||||||
///
|
///
|
||||||
/// To define a pretty-print name, call [`with_name`][`TypeBuilder::with_name`],
|
/// To define a pretty-print name, call [`with_name`][`TypeBuilder::with_name`],
|
||||||
/// to use [`Engine::register_type_with_name`] instead.
|
/// to use [`Engine::register_type_with_name`] instead.
|
||||||
///
|
|
||||||
/// # WARNING - Volatile Type
|
|
||||||
///
|
|
||||||
/// This type is volatile and may change in the future.
|
|
||||||
#[deprecated = "This type is NOT deprecated, but it is considered volatile and may change in the future."]
|
|
||||||
pub struct TypeBuilder<'a, T: Variant + Clone> {
|
pub struct TypeBuilder<'a, T: Variant + Clone> {
|
||||||
engine: &'a mut Engine,
|
engine: &'a mut Engine,
|
||||||
name: Option<&'static str>,
|
name: Option<&'static str>,
|
||||||
|
Loading…
Reference in New Issue
Block a user