Yex.WeakLink (y_ex v0.10.5)

View Source

⚠️ Experimental

A weak link to a value in a shared map.

Type Safety Note: WeakLink does not store runtime type information. Callers must use the correct method based on the original source type:

Calling the wrong method may result in undefined behavior or panics.

Summary

Functions

Converts the weak link to its preliminary representation.

Dereferences the (Map) weak link to obtain the actual value it points to.

Converts the (Array) weak link to a list of its elements.

Converts the (Text/XMLText) weak link to its string representation.

Types

t()

@type t() :: %Yex.WeakLink{doc: Yex.Doc.t(), reference: reference()}

Functions

as_prelim(weak)

@spec as_prelim(t()) :: Yex.WeakPrelim.t()

Converts the weak link to its preliminary representation.

deref(weak)

@spec deref(t()) :: any()

Dereferences the (Map) weak link to obtain the actual value it points to.

to_list(weak)

@spec to_list(t()) :: list()

Converts the (Array) weak link to a list of its elements.

to_string(weak)

@spec to_string(t()) :: String.t()

Converts the (Text/XMLText) weak link to its string representation.