WithDerives

Trait WithDerives 

Source
pub trait WithDerives: Sized {
    // Required methods
    fn derives(&self) -> &[String];
    fn add_derive<S>(&mut self, derive: S)
       where S: Into<String>;

    // Provided methods
    fn with_derive<S>(self, derive: S) -> Self
       where S: Into<String> { ... }
    fn write_derives(&self, b: &mut CodeBuffer, level: usize) { ... }
}

Required Methods§

Source

fn derives(&self) -> &[String]

Gets the derives.

Source

fn add_derive<S>(&mut self, derive: S)
where S: Into<String>,

Adds the derivation.

Provided Methods§

Source

fn with_derive<S>(self, derive: S) -> Self
where S: Into<String>,

Adds the derivation.

Source

fn write_derives(&self, b: &mut CodeBuffer, level: usize)

Writes the derive tag.

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§