pub trait IEnumeration {
// Required methods
fn current_value<T: ValueStore, U: CacheStore>(
&self,
device: &mut impl Device,
store: &impl NodeStore,
cx: &mut ValueCtxt<T, U>
) -> GenApiResult<i64>;
fn current_entry<T: ValueStore, U: CacheStore>(
&self,
device: &mut impl Device,
store: &impl NodeStore,
cx: &mut ValueCtxt<T, U>
) -> GenApiResult<NodeId>;
fn entries(&self, store: &impl NodeStore) -> &[NodeId];
fn set_entry_by_symbolic<T: ValueStore, U: CacheStore>(
&self,
name: &str,
device: &mut impl Device,
store: &impl NodeStore,
cx: &mut ValueCtxt<T, U>
) -> GenApiResult<()>;
fn set_entry_by_value<T: ValueStore, U: CacheStore>(
&self,
value: i64,
device: &mut impl Device,
store: &impl NodeStore,
cx: &mut ValueCtxt<T, U>
) -> GenApiResult<()>;
fn is_readable<T: ValueStore, U: CacheStore>(
&self,
device: &mut impl Device,
store: &impl NodeStore,
cx: &mut ValueCtxt<T, U>
) -> GenApiResult<bool>;
fn is_writable<T: ValueStore, U: CacheStore>(
&self,
device: &mut impl Device,
store: &impl NodeStore,
cx: &mut ValueCtxt<T, U>
) -> GenApiResult<bool>;
// Provided method
fn entry_by_symbolic(
&self,
name: &str,
store: &impl NodeStore
) -> Option<NodeId> { ... }
}
Get NodeId
of enum entry which has specified symbolic name.