glue

Types

pub type Error {
  ParseError(glance.Error)
  TypeNotFound(type_name: String)
  TypeIsNotEnum(type_name: String, variant: String)
}

Constructors

  • ParseError(glance.Error)
  • TypeNotFound(type_name: String)
  • TypeIsNotEnum(type_name: String, variant: String)

Functions

pub fn generate_compare(
  src: String,
  type_name: String,
) -> Result(String, Error)

Generate a function that lists all the variants of a given custom type.

Errors if:

  • The source is invalid.
  • If type cannot be found.
  • If the type has variants that are records and as such cannot be listed without being given arguments.
pub fn generate_list_variants(
  src: String,
  type_name: String,
) -> Result(String, Error)

Generate a function that lists all the variants of a given custom type.

Errors if:

  • The source is invalid.
  • If type cannot be found.
  • If the type has variants that are records and as such cannot be listed without being given arguments.
Search Document