Skip to main content

ModuleDisplay

Trait ModuleDisplay 

pub trait ModuleDisplay: ModuleDisplayDefault {
    // Provided methods
    fn format(&self, passed_settings: DisplaySettings) -> String { ... }
    fn custom_settings(&self) -> Option<DisplaySettings> { ... }
    fn custom_content(&self, _content: Content) -> Option<Content> { ... }
}
Expand description

Trait to implement custom display settings for a module.

In order to implement custom display settings for a module,

  1. Add #[module(custom_display)] attribute to the module struct after #[derive(Module)]
  2. Implement ModuleDisplay trait for the module

Provided Methods§

fn format(&self, passed_settings: DisplaySettings) -> String

Formats the module with provided display settings.

§Arguments
  • passed_settings - Display settings passed to the module.
§Returns

A string representation of the formatted module.

fn custom_settings(&self) -> Option<DisplaySettings>

Custom display settings for the module.

§Returns

An optional display settings object.

fn custom_content(&self, _content: Content) -> Option<Content>

Custom attributes for the module.

§Arguments
  • _content - The content object that contains display settings and attributes.
§Returns

An optional content object containing the custom attributes.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

§

impl ModuleDisplay for String

§

impl ModuleDisplay for bool

§

impl ModuleDisplay for f32

§

impl ModuleDisplay for f64

§

impl ModuleDisplay for i8

§

impl ModuleDisplay for i16

§

impl ModuleDisplay for i32

§

impl ModuleDisplay for i64

§

impl ModuleDisplay for isize

§

impl ModuleDisplay for str

§

impl ModuleDisplay for u8

§

impl ModuleDisplay for u16

§

impl ModuleDisplay for u32

§

impl ModuleDisplay for u64

§

impl ModuleDisplay for usize

§

impl<L0, L1, L2, L3, L4, L5, L6, L7, L8, L9> ModuleDisplay for (L0, L1, L2, L3, L4, L5, L6, L7, L8, L9)

§

impl<L0, L1, L2, L3, L4, L5, L6, L7, L8> ModuleDisplay for (L0, L1, L2, L3, L4, L5, L6, L7, L8)

§

impl<L0, L1, L2, L3, L4, L5, L6, L7> ModuleDisplay for (L0, L1, L2, L3, L4, L5, L6, L7)

§

impl<L0, L1, L2, L3, L4, L5, L6> ModuleDisplay for (L0, L1, L2, L3, L4, L5, L6)

§

impl<L0, L1, L2, L3, L4, L5> ModuleDisplay for (L0, L1, L2, L3, L4, L5)
where L0: ModuleDisplay, L1: ModuleDisplay, L2: ModuleDisplay, L3: