Kinda.Resource.Declaration (kinda v0.12.0)

Copy Markdown View Source

Declares the stable lifecycle contract of a native resource.

Declarations are data: generated bindings and test tooling can inspect the same identity, ownership and upgrade promises without coupling production code to a test observer.

Summary

Types

t()

@type t() :: %Kinda.Resource.Declaration{
  abi_version: pos_integer(),
  identity: atom() | binary(),
  owner: atom() | binary() | nil,
  upgrade: upgrade()
}

upgrade()

@type upgrade() :: :unsupported | :takeover

Functions

new(identity, options \\ [])

@spec new(
  atom() | binary(),
  keyword()
) :: t()

supports_upgrade?(declaration)

@spec supports_upgrade?(t()) :: boolean()