Trait Instance

Source
pub trait Instance: Any {
    // Required methods
    fn items(&self) -> impl Iterator<Item = &Item>;
    fn containers(&self) -> impl Iterator<Item = &Container>;
    fn item(&self, id: usize) -> &Item;
    fn container(&self, id: usize) -> &Container;
}
Expand description

The static (unmodifiable) representation of a problem instance. This trait defines shared functionality between any instance variant.

Required Methods§

Source

fn items(&self) -> impl Iterator<Item = &Item>

All items

Source

fn containers(&self) -> impl Iterator<Item = &Container>

All containers

Source

fn item(&self, id: usize) -> &Item

A specific item

Source

fn container(&self, id: usize) -> &Container

A specific container

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§