pub struct Constant { /* private fields */ }
Expand description
Defines a constant that will be inlined on scripts.
Implementations§
Source§impl Constant
impl Constant
Sourcepub fn new<Value: Into<MoonValue>>(value: Value) -> Constant
pub fn new<Value: Into<MoonValue>>(value: Value) -> Constant
Creates a new constant out of this value by mapping it into a MoonValue
Sourcepub fn associated_type<'input, Name: Into<MoonValueKind<'input>>>(
self,
name: Name,
) -> Self
pub fn associated_type<'input, Name: Into<MoonValueKind<'input>>>( self, name: Name, ) -> Self
Specifies what kind type is associated to this constant, see the Properties section of the book for more information about properties.
Sourcepub fn associated_type_of<T>(self) -> Self
pub fn associated_type_of<T>(self) -> Self
Specifies what kind type is associated to this constant, but instead of receiving a name or a crate::MoonValueKind, it receives the value’s type, this is preferred over Self::associated_type but it doesn’t allow you to create pseudo-types, requiring the use of real types.
see the Properties section of the book for more information about properties.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Constant
impl RefUnwindSafe for Constant
impl Send for Constant
impl Sync for Constant
impl Unpin for Constant
impl UnwindSafe for Constant
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more