View Source Drops.Types.Cast (drops v0.2.1)

Drops.Types.Cast is a struct that represents a cast type with input and output types.

Examples

iex> Drops.Type.Compiler.visit(
...>   {:cast, {{:type, {:integer, []}}, {:type, {:date_time, []}}, [:miliseconds]}},
...>   []
...> )
%Drops.Types.Cast{
  input_type: %Drops.Types.Primitive{
    primitive: :integer,
    constraints: [predicate: {:type?, :integer}]
  },
  output_type: %Drops.Types.Primitive{
    primitive: :date_time,
    constraints: [predicate: {:type?, :date_time}]
  },
  opts: [:miliseconds]
}

Summary

Types

@type t() :: %Drops.Types.Cast{input_type: term(), opts: term(), output_type: term()}

Functions

Link to this function

new(input_type, output_type, opts)

View Source