mod directive_options

module directive_options

Enums

enum DirectiveOption

Enum to represent the various options for the directives.

The enum implements the RstOption and MdOption traits for easily converting the options to required text.

Index(IndexEntryType)

The :index: option

Vis(DirectiveVisibility)

The :vis: option.

Layout(Vec<Node>)

The :layout: option.

Toc(String)

The :toc: option.

Traits implemented

impl RstOption for DirectiveOption

Functions

fn get_rst_text(&self, indent: &str) -> Option<String>
impl MdOption for DirectiveOption

Functions

fn get_md_text(&self) -> Option<String>
enum DirectiveVisibility

Enum for the values of the DirectiveOption::Vis option

The enum is ordered Pub < Crate < Pvt, so it can be efficiently compared for filtering. Note that ordering here is opposite to that of the visibility itself.

Pub

Public visibility

Crate

Crate visibility

Pvt

Private visibility

Implementations

impl DirectiveVisibility

Functions

fn effective_visibility(visibility: &Visibility, inherited_visibility: &Option<&Visibility>) -> Self

Determine the effective visibility for an item based on its visibility or its parent’s visibility.

Args:
visibility:

The item’s visibility.

inherited_visibility:

The visibility of the item’s parent.

Returns:

The directive visibility applicable to the item.

Traits implemented

impl Display for DirectiveVisibility

Functions

fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result
impl From<&Visibility> for DirectiveVisibility

Functions

fn from(value: &Visibility) -> Self
impl FromStr for DirectiveVisibility

Types

type Err

Functions

fn from_str(s: &str) -> Result<Self, Self::Err>
enum IndexEntryType

The different index entry types.

This corresponds to the Python enum sphinxcontrib_rust.items.SphinxIndexEntryType.

None
Normal
WithSubEntries
SubEntry