WithTypeDecs

Trait WithTypeDecs 

Source
pub trait WithTypeDecs: Sized {
    // Required methods
    fn type_decs(&self) -> &[TypeDec];
    fn add_type_dec<D>(&mut self, type_dec: D)
       where D: Into<TypeDec>;

    // Provided methods
    fn with_type_dec<D>(self, type_dec: D) -> Self
       where D: Into<TypeDec> { ... }
    fn write_type_decs(&self, b: &mut CodeBuffer, level: usize) { ... }
}
Expand description

An element with type declarations.

Required Methods§

Source

fn type_decs(&self) -> &[TypeDec]

Gets the type decs.

Source

fn add_type_dec<D>(&mut self, type_dec: D)
where D: Into<TypeDec>,

Adds the type_dec.

Provided Methods§

Source

fn with_type_dec<D>(self, type_dec: D) -> Self
where D: Into<TypeDec>,

Adds the type_dec.

Source

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

Writes the type declarations.

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§