Struct

std::cap::Shared!

source

Re-exported from core::cap::Shared!.

forall 'r, 'q.
struct Shared! { ... }

A shared read capability for domain 'r: one node 'q of a tree of readers.

Every shared node carries two brands, and the distinction is the design:

'r the DOMAIN brand, the same one its Exclusive!['r] carries. It never changes anywhere in the tree. 'q the LINEAGE brand, minted fresh by share and twice by every split. It names one specific node of one specific tree.

With the domain brand alone every node would be interchangeable, and the writer could come back from ONE half of a split while the other half still reads: share, split, resume from a leaf, free the resource, read through the sibling. SharedResume!['r,'q] instead demands the root node Shared!['r,'q] by identity, and a leaf's sealed, freshly minted lineage cannot unify with 'q. The rejection is an ordinary type mismatch, with no special rule.

Methods

method splitsource

fn split(self) -> exists 'a, 'b. (Shared!['r, 'a], Shared!['r, 'b], SharedJoin!['r, 'q, 'a, 'b]) { ... }

Two fresh shared readers in place of this one, and the receipt that joins them back.

Instances

instance Borrow[Ref[T, 'k], Shared!['k, 'q], Borrowed![T, 'k, 'q]]source

forall T, 'k, 'q.
instance Borrow[Ref[T, 'k], Shared!['k, 'q], Borrowed![T, 'k, 'q]] { ... }

In std::borrow.

A Ref borrows as a Borrowed! through a Shared! capability of its domain.

instance ReadBytes[Shared!['r, 'q], Slice[u8, 'r]]source

forall 'r, 'q.
instance ReadBytes[Shared!['r, 'q], Slice[u8, 'r]] { ... }

In std::slice.

A byte slice is read through any node of its domain's shared-read tree.

instance ReadBytes[Shared!['r, 'q], Str['r]]source

forall 'r, 'q.
instance ReadBytes[Shared!['r, 'q], Str['r]] { ... }

In std::str.

Text is read through any node of its domain's shared-read tree.