Documentation
¶
Overview ¶
Package wire implements the optional ontos/wire value profile over deixis. C is an opaque, caller-supplied sending face. Capturing C does not recognize, attenuate, invoke or export it. The package has no runtime or type-system dependency.
Index ¶
- Constants
- Variables
- func Recover[C any](value Value[C], limits Limits) (core.Value, error)
- type Code
- type Error
- type Kind
- type Limits
- type NativeFactory
- type NativeTuple
- type NativeValue
- type Payload
- type Value
- func Admit[C any](node deixis.Node[Payload[C]], limits Limits) (Value[C], error)
- func Embed[C any](value core.Value, limits Limits) (Value[C], error)
- func NewAtom[C any](bytes []byte, limits Limits) (Value[C], error)
- func NewTuple[C any](items []Value[C], limits Limits) (Value[C], error)
- func NewWire[C any](handle C) Value[C]
- func ProjectNative[C any](factory *NativeFactory[C], value NativeValue, limits Limits) (Value[C], error)
Constants ¶
const PositionSpelling = pos.Profile
const Profile = "ontos/wire"
const Revision = 1
Variables ¶
var ErrNativeValue = errors.New("ontos/wire: unqualified native value")
Functions ¶
Types ¶
type Limits ¶
Limits count the unfolded tree: root depth zero, every node occurrence, every atom byte and every structural positional-key byte. Opaque handle internals are never visited. Limits are operational, not value semantics.
func DefaultLimits ¶
func DefaultLimits() Limits
type NativeFactory ¶
type NativeFactory[C any] struct { // contains filtered or unexported fields }
NativeFactory composes a caller-owned leaf policy with shared immutable value structure. capture must recognize/attenuate a leaf without sending, exporting or testing liveness. Ontos never supplies a runtime capability policy.
func NewNativeFactory ¶
func NewNativeFactory[C any](capture func(NativeValue) (C, error)) *NativeFactory[C]
func (*NativeFactory[C]) Capture ¶
func (f *NativeFactory[C]) Capture(value NativeValue) (NativeValue, error)
Capture is shallow: a factory-owned immutable tuple already qualified its children. A tuple made under another policy is not proof under this policy.
func (*NativeFactory[C]) Tuple ¶
func (f *NativeFactory[C]) Tuple(items ...NativeValue) (NativeValue, error)
Tuple captures only its immediate children. Wire-free tuples collapse to the original ground representation. Shared mixed descendants remain shared.
type NativeTuple ¶
type NativeTuple[C any] struct { // contains filtered or unexported fields }
NativeTuple owns structure, not authority. Its factory's private identity proves only that its immediate children were captured by that same policy. Native construction does not unfold sharing or apply Deixis conversion limits.
func (NativeTuple[C]) At ¶
func (t NativeTuple[C]) At(i int) NativeValue
func (NativeTuple[C]) Items ¶
func (t NativeTuple[C]) Items() []NativeValue
func (NativeTuple[C]) Len ¶
func (t NativeTuple[C]) Len() int
type NativeValue ¶
type NativeValue = any
NativeValue is the compact native realization: a ground Atom/Tuple, an immutable NativeTuple[C], or an opaque C recognized by its NativeFactory. The open Go union is checked by Capture; interface satisfaction is insufficient. Ground values keep their native identity. This is not a ground core.Value.
func NativeFromValue ¶
func NativeFromValue[C any](factory *NativeFactory[C], value Value[C], limits Limits) (NativeValue, error)
NativeFromValue explicitly qualifies a bounded Deixis value under a native factory. An opaque handle in Value is never itself evidence of recognition.
func NativeItems ¶
func NativeItems[C any](value NativeValue) ([]NativeValue, bool)
NativeItems observes structure, without establishing capability recognition.
type Payload ¶
type Payload[C any] struct { // contains filtered or unexported fields }
Payload is a closed sum. Its zero value is the tuple's None alternative. Atom storage is an immutable ground Atom; C is retained exactly as supplied. Runtime composition is responsible for supplying send-only faces, not owners.
func WirePayload ¶
type Value ¶
type Value[C any] struct { // contains filtered or unexported fields }
Value is an admitted, immutable mixed value. The zero value is invalid. It exposes no universal equality, hash, codec or operational Wire method. The cached measures count occurrences even when immutable storage is shared.
func Admit ¶
Admit recognizes exactly the mixed profile, without normalization. It accepts native immutable deixis nodes rather than invoking arbitrary user tree methods. Known cardinality plus every exact positional key establishes a dense domain; Get avoids copying an unbounded child/key collection merely to check a limit.
func Embed ¶
Embed preserves ground values and their exact deixis positional layout. It is total semantically; operational budget exhaustion remains a refusal.
func NewWire ¶
NewWire does constant structural work: one node, depth zero, zero data/key bytes. Even a nil C is structurally opaque; runtime recognition is separate.
func ProjectNative ¶
func ProjectNative[C any](factory *NativeFactory[C], value NativeValue, limits Limits) (Value[C], error)
ProjectNative explicitly converts a qualified compact value to the bounded Deixis representation. Its limits are structural, never a runtime send budget.
func (Value[C]) At ¶
At is a positional observation. Re-admission uses the supplied limits and returns no usable value on failure. This avoids hidden unbounded traversal.