View Source NotLoaded (NotLoaded v0.3.0)
Struct returned by fields when they have not been loaded.
Example
# Define your NotLoaded module
NotLoaded.defmodule(MyApp.NotLoaded)
# Use this module in your application
defmodule MyApp.Book do
import MyApp.NotLoaded, only: [lazy_loaded: 1]
defstruct [
:title,
lazy_loaded(:author)
]
end
Summary
Functions
Generate a NotLoaded module
lazy_loaded(field_name)
deprecated
Defaults a struct field to NotLoaded
.
new(field_name)
deprecated
Creates a new NotLoaded
struct for a given field name.
Types
@type field_name() :: atom()
@type t() :: %NotLoaded{__field__: field_name()}
Functions
Generate a NotLoaded module
This macro is deprecated. Use `defmodule/1` to define an application specific NotLoaded module, instead.
Defaults a struct field to NotLoaded
.
This function is deprecated. Use defmodule/1 to define an application specific NotLoaded module, instead.
@spec new(field_name()) :: t()
Creates a new NotLoaded
struct for a given field name.