WEBVTT

00:00:00.500 --> 00:00:02.036
Branch nine is attached.

00:00:02.937 --> 00:00:05.957
When the Shop installed, App opened the root's attachments,

00:00:06.153 --> 00:00:09.577
bound Branches and Settings to their memories, and gave Checkout

00:00:09.590 --> 00:00:11.348
references to both services.

00:00:12.246 --> 00:00:14.160
These are Rust service objects.

00:00:15.059 --> 00:00:18.028
Each binding identifies the memory the service is allowed to

00:00:18.041 --> 00:00:18.640
use.

00:00:19.538 --> 00:00:22.650
The Shop test puts item forty-four in branch nine.

00:00:23.548 --> 00:00:25.215
Each unit costs a hundred.

00:00:26.114 --> 00:00:27.403
There are eight in stock.

00:00:28.301 --> 00:00:30.606
Settings holds the five percent tax.

00:00:32.733 --> 00:00:35.779
A checkout asks for three units of item forty-four.

00:00:36.680 --> 00:00:39.128
The actor opens one write scope for the call.

00:00:40.026 --> 00:00:43.125
Checkout gets a borrowed view in that scope and uses it to call

00:00:43.138 --> 00:00:44.805
the Branches service for a quote.

00:00:45.703 --> 00:00:49.271
Branches looks up key nine in its Child Map and uses that reference

00:00:49.284 --> 00:00:51.641
to bind an Inventory service for the operation.

00:00:52.539 --> 00:00:54.466
The attachment still owns the memory.

00:00:55.365 --> 00:00:58.255
The Inventory view can read its data while the caller's scope

00:00:58.268 --> 00:00:58.854
is open.

00:00:59.753 --> 00:01:02.344
Inventory opens a read guard on its own data.

00:01:03.242 --> 00:01:06.576
Eight are available, so three at a hundred gives a subtotal

00:01:06.589 --> 00:01:07.409
of three hundred.

00:01:08.308 --> 00:01:09.479
The guard closes.

00:01:10.378 --> 00:01:12.461
The quote returns the number to Checkout.

00:01:14.600 --> 00:01:16.644
Checkout asks Settings for the tax.

00:01:17.544 --> 00:01:21.477
Settings reads its own data and returns five hundred basis points.

00:01:22.375 --> 00:01:24.602
Checkout applies that rate to the subtotal.

00:01:25.500 --> 00:01:27.688
The total is three hundred and fifteen.

00:01:28.586 --> 00:01:31.438
Checkout asks Branches to sell the three units.

00:01:32.336 --> 00:01:34.979
Branches binds the inventory again for this call.

00:01:35.878 --> 00:01:39.458
Now Inventory opens a write guard, checks the quantity, and

00:01:39.471 --> 00:01:40.773
takes three from stock.

00:01:41.672 --> 00:01:42.675
Five remain.

00:01:43.573 --> 00:01:45.943
Checkout returns three hundred and fifteen.

00:01:46.841 --> 00:01:48.664
The test asks for six next.

00:01:49.563 --> 00:01:51.047
Inventory has five.

00:01:51.945 --> 00:01:55.396
The quote comes back empty, so Checkout returns early from this

00:01:55.409 --> 00:01:55.852
call.

00:01:57.967 --> 00:01:59.685
The native test drops the App.

00:02:00.586 --> 00:02:02.370
Its service objects go away.

00:02:03.268 --> 00:02:05.963
Branch nine and the tax setting are still in the Store.

00:02:06.862 --> 00:02:10.156
The test opens the same Store and App builds fresh services.

00:02:11.055 --> 00:02:14.779
It reads the five hundred basis point tax and finds branch nine

00:02:14.792 --> 00:02:15.742
under Branches.

00:02:16.640 --> 00:02:18.685
Follow that branch to its item map.

00:02:19.583 --> 00:02:22.812
Nyxus stores the map's entries as native Rust values in the

00:02:22.825 --> 00:02:23.672
retained heap.

