MutableIndirection

public protocol MutableIndirection

A smart pointer whose pointee can also be mutated through the peel. Writes (wrapper.field = v), compound assignments (wrapper.n += 1), and mutating-method calls route through pointeeMutRef(). A read-only wrapper conforms to Indirection only; mutating through it is rejected.

pointeeMutRef() is mutating so a copy-on-write wrapper can fork its storage before handing out the mutable view; wrappers that don't need to (raw Pointer, RcBox) still mark it mutating — the marker is harmless.

Methods

mutating func pointeeMutRef() -> &mutating Target

A mutating reference to the pointee. Member WRITES / RMW / mutating methods peel through this.

ImplementsIndirection

Associated Types

type Target

The pointee type that member access forwards to.

Methods

func pointeeRef() -> &Target

A shared reference to the pointee. Member READS peel through this.

Defined in lang/std/core/indirection.ks