Skip to main content

SingletonTable

Trait SingletonTable 

Source
pub trait SingletonTable: Table {
    const NAME: &'static str;

    // Provided method
    fn table_name() -> TableName<Self>
       where Self: Sized { ... }
}
Expand description

A table value type that exactly one table uses: NAME is that table’s name.

A value type that implements this trait lets a reader or a writer refer to its table by the Rust type alone: StageCx::get_singleton, ComputedView::get_singleton and StageOut::table_singleton find the name through it.

A value type declared under several names, such as the type holding one backend’s lowered trees, must not implement this trait, since it has no single name. For that reason NAME is defined on this separate trait rather than on Table: on Table, it would force such a value type to invent a name.

Required Associated Constants§

Source

const NAME: &'static str

The name of the one table that uses this value type.

Provided Methods§

Source

fn table_name() -> TableName<Self>
where Self: Sized,

The typed table key (TableName) of that one table.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl SingletonTable for Anchors

Source§

const NAME: &'static str = "flm.anchors"

Source§

impl SingletonTable for CitationEntries

Source§

const NAME: &'static str = "flm.citations.entries"

Source§

impl SingletonTable for CitedKeys

Source§

const NAME: &'static str = "flm.citations.keys"

Source§

impl SingletonTable for CitedWorks

Source§

const NAME: &'static str = "flm.citations"

Source§

impl SingletonTable for Counters

Source§

const NAME: &'static str = "flm.counters"

Source§

impl SingletonTable for ElementIndex

Source§

const NAME: &'static str = "flm.element-index"

Source§

impl SingletonTable for ExternalIndex

Source§

const NAME: &'static str = "flm.refs.external-index"

Source§

impl SingletonTable for GraphicsInfo

Source§

const NAME: &'static str = "flm.graphics.info"

Source§

impl SingletonTable for HtmlFragments

Source§

const NAME: &'static str = "flm.output.html"

Source§

impl SingletonTable for HtmlPieces

Source§

const NAME: &'static str = "flm.output.html.pieces"

Source§

impl SingletonTable for Labels

Source§

const NAME: &'static str = "flm.labels"

Source§

impl SingletonTable for RefPoints

Source§

const NAME: &'static str = "flm.refpoints"

Source§

impl SingletonTable for RefResolutions

Source§

const NAME: &'static str = "flm.refs.resolutions"

Source§

impl SingletonTable for RefTargets

Source§

const NAME: &'static str = "flm.refs.targets"

Source§

impl SingletonTable for ResolvedDefinitions

Source§

const NAME: &'static str = "flm.html.definitions"

Source§

impl SingletonTable for TextOutput

Source§

const NAME: &'static str = "flm.output.text"

Source§

impl SingletonTable for TocEntries

Source§

const NAME: &'static str = "flm.toc.entries"

Source§

impl SingletonTable for Xnotes

Source§

const NAME: &'static str = "flm.xnotes"