View Source EnvGuard.Cast (env_guard v1.0.0)

Defines functions that cast values to a specific type.

Summary

Functions

Takes in a string value and casts it to the specified type.

Types

Functions

@spec cast(any(), type()) :: {:ok, any()} | {:error, :cast_fail, String.t()}

Takes in a string value and casts it to the specified type.

Returns an error if the cast is not possible.