Struct

core::cap::Exclusive!

source
forall 'r.
struct Exclusive! { ... }

The sole read and write capability for domain 'r.

Methods

method freshsource

fn fresh() -> exists 'r. (Brand['r], Exclusive!['r]) { ... }

A capability for a new domain, with that domain's brand.

The only minting path. Freshness prevents an existing domain from acquiring a second Exclusive! token through a copied Brand.

method stampsource

fn stamp(&self) -> Stamp['r] { ... }

The domain's brand, sealed in a Stamp that only core can open.

method sharesource

fn share(self) -> exists 'q. (Shared!['r, 'q], SharedResume!['r, 'q]) { ... }

Trades the capability for the root of a tree of shared readers and the receipt that turns that root back into it.

method retiresource

fn retire(self) -> () { ... }

Ends the capability.

A resource's finalizer can consume its exclusive token here after retiring the protected state. This does not deallocate anything.

Instances

instance Access[Exclusive!['k] -> 'k, ()]source

forall 'k.
instance Access[Exclusive!['k] -> 'k, ()] { ... }

In core::cap.

An Exclusive! lends itself, with nothing else held.

instance ReadBytes[Exclusive!['r], Slice[u8, 'r]]source

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

In core::slice.

A byte slice is read through its domain's Exclusive!.

instance ReadBytes[Exclusive!['r], Str['r]]source

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

In core::str.

Text is read through its domain's Exclusive!.