# Trait cargo::util::toml::WorkspaceInherit

source ·

    pub trait WorkspaceInherit {
        // Required methods
        fn inherit_toml_table(&self) -> &str;
        fn workspace(&self) -> bool;
    }

Expand description

This Trait exists to make `schema::MaybeWorkspace::Workspace` generic. It makes deserialization of `schema::MaybeWorkspace` much easier, as well as making error messages for `schema::MaybeWorkspace::resolve` much nicer

Implementors should have a field `workspace` with the type of `bool`. It is used to ensure `workspace` is not `false` in a `Cargo.toml`

## Required Methods§

source

#### fn inherit_toml_table(&self) -> &str

This is the workspace table that is being inherited from. For example `[workspace.dependencies]` would be the table “dependencies”

source

#### fn workspace(&self) -> bool

This is used to output the value of the implementors `workspace` field

## Implementors§

source§

### impl WorkspaceInherit for TomlWorkspaceDependency

source§

### impl WorkspaceInherit for TomlWorkspaceField