Enum koto_runtime::MetaKey
source · pub enum MetaKey {
BinaryOp(BinaryOp),
UnaryOp(UnaryOp),
Call,
Named(KString),
Test(KString),
Tests,
PreTest,
PostTest,
Main,
Type,
Base,
}
Expand description
The key type used by MetaMaps
Variants§
BinaryOp(BinaryOp)
A binary operation
e.g. @+
, @==
UnaryOp(UnaryOp)
A unary operation
e.g. @not
Call
Function call - @||
Defines the behaviour when performing a function call on the value.
Named(KString)
A named key
e.g. @meta my_named_key
Named entries are used in KMaps, so that shared named items can be made available without them being inserted into the map’s contents.
Test(KString)
A test function
e.g. @test my_test
Tests
@tests
Tests are defined together in a KMap.
PreTest
@pre_test
Used to define a function that will be run before each @test
.
PostTest
@post_test
Used to define a function that will be run after each @test
.
Main
@main
Used to define a function that will be run when a module is first imported.
Type
@type
Provides a KString that declares the value’s type.
Base
@base
Defines a base map to be used as fallback for accesses when a key isn’t found.
Trait Implementations§
source§impl Equivalent<MetaKey> for KString
impl Equivalent<MetaKey> for KString
source§fn equivalent(&self, other: &MetaKey) -> bool
fn equivalent(&self, other: &MetaKey) -> bool
key
and return true
if they are equal.source§impl Equivalent<MetaKey> for str
impl Equivalent<MetaKey> for str
source§fn equivalent(&self, other: &MetaKey) -> bool
fn equivalent(&self, other: &MetaKey) -> bool
key
and return true
if they are equal.source§impl PartialEq for MetaKey
impl PartialEq for MetaKey
impl Eq for MetaKey
impl StructuralPartialEq for MetaKey
Auto Trait Implementations§
impl Freeze for MetaKey
impl RefUnwindSafe for MetaKey
impl Send for MetaKey
impl Sync for MetaKey
impl Unpin for MetaKey
impl UnwindSafe for MetaKey
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
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.