Trait koto_runtime::KotoEntries

source ·
pub trait KotoEntries {
    // Provided method
    fn entries(&self) -> Option<KMap> { ... }
}
Expand description

A trait that allows objects to support ‘.’ lookups

This is the mechanism for attaching custom methods to objects in the Koto runtime.

The #[koto_impl] macro provides an easy way to declare methods that should be made available via lookup by using the #[koto_method] attribute, and then derives an appropriate implementation of KotoEntries.

Provided Methods§

source

fn entries(&self) -> Option<KMap>

Returns an optional KMap containing entries that can be accessed via the ‘.’ operator.

Implementations should return a clone of a cached map. None is returned by default.

Implementors§