gleamgen/types/custom

Types

pub type CustomType(repr, variants, generics) {
  CustomType(
    variants: List(Variant(Unchecked)),
    generics_list: List(String),
    generics: generics,
  )
}

Constructors

  • CustomType(
      variants: List(Variant(Unchecked)),
      generics_list: List(String),
      generics: generics,
    )

Functions

pub fn new(typed_representation: a) -> CustomType(a, #(), #())
pub fn new_unchecked(
  typed_representation: a,
  variants: List(Variant(Unchecked)),
  generics_list: List(String),
) -> CustomType(a, b, List(GeneratedType(Unchecked)))
pub fn render(type_: CustomType(a, b, c)) -> Rendered
pub fn to_unchecked(
  old: CustomType(a, b, c),
) -> CustomType(Unchecked, Nil, Nil)
pub fn with_generic(
  old: CustomType(a, b, c),
  generic: String,
) -> CustomType(a, b, #(c, GeneratedType(Unchecked)))
pub fn with_unchecked_variants(
  old: CustomType(a, b, c),
  variants: fn(c) -> List(Variant(Unchecked)),
) -> CustomType(a, Unchecked, c)
pub fn with_variant(
  old: CustomType(a, b, c),
  variant: fn(c) -> Variant(d),
) -> CustomType(a, #(b, d), c)
Search Document