pub struct OutgoingResources<C>where
C: ResourceTable<OutgoingResourceState>,{ /* private fields */ }Implementations§
Source§impl<C> OutgoingResources<C>where
C: ResourceTable<OutgoingResourceState>,
impl<C> OutgoingResources<C>where
C: ResourceTable<OutgoingResourceState>,
Sourcepub fn lane_for(
&self,
link_id: &LinkId,
segment: &ResourceSegment,
) -> Result<TrackLane, TrackOutgoingResourceError>
pub fn lane_for( &self, link_id: &LinkId, segment: &ResourceSegment, ) -> Result<TrackLane, TrackOutgoingResourceError>
One resource per link at a time, matching RNS 1.4.2 Link.ready_for_new_resource.
Intentional deviation from reference: the next continuation segment may land beside the link’s one occupied row and remain off the wire until the segment ahead proves. Its preparation therefore overlaps the wire instead of following it.
The occupied row may itself still be staged: a proof settles its segment before the follower finishes sealing, and the host’s next dispatch lands in that window.
The wire still carries one resource at a time; a second row already waiting, or anything that is not the exact continuation, stays LinkBusy.
Sourcepub fn track_built(
&mut self,
command: TrackedCommand,
lane: TrackLane,
build: impl FnOnce(BuildRegions<'_>) -> Result<BuiltResource, BuildOutgoingResourceError>,
) -> Result<ResourceHash, TrackOutgoingResourceError>
pub fn track_built( &mut self, command: TrackedCommand, lane: TrackLane, build: impl FnOnce(BuildRegions<'_>) -> Result<BuiltResource, BuildOutgoingResourceError>, ) -> Result<ResourceHash, TrackOutgoingResourceError>
A failed build releases the slot untouched.
A Staged lane lands the finished build as StagedSealed: the compressed-continuation path, whose stream cannot re-derive its digests later and so seals here.
Sourcepub fn stage_raw(
&mut self,
command: TrackedCommand,
has_metadata: bool,
stream_len: usize,
prefill: impl FnOnce(&mut [u8]),
) -> Result<usize, TrackOutgoingResourceError>
pub fn stage_raw( &mut self, command: TrackedCommand, has_metadata: bool, stream_len: usize, prefill: impl FnOnce(&mut [u8]), ) -> Result<usize, TrackOutgoingResourceError>
The uncompressed-continuation path parks the raw stream at its sealed offset and defers the whole seal to seal_regions_mut time. It returns the landed row’s index because the placeholder hash can never name it.
Sourcepub fn staged_index(&self, link_id: &LinkId) -> Option<usize>
pub fn staged_index(&self, link_id: &LinkId) -> Option<usize>
The link’s next staged row in segment order. With a follower parked behind a still-sealing row, the lower segment index promotes first.
Sourcepub fn seal_regions_mut(&mut self, index: usize) -> BuildRegions<'_>
pub fn seal_regions_mut(&mut self, index: usize) -> BuildRegions<'_>
The mutable transfer + name regions a deferred seal writes, borrowed together like a build’s.
pub fn lookup(&self, link_id: &LinkId, hash: &ResourceHash) -> Option<usize>
pub fn state(&self, index: usize) -> &OutgoingResourceState
pub fn state_mut(&mut self, index: usize) -> &mut OutgoingResourceState
pub fn set_hash(&mut self, index: usize, hash: ResourceHash)
Sourcepub fn staged_plaintext(&self, index: usize) -> &[u8] ⓘ
pub fn staged_plaintext(&self, index: usize) -> &[u8] ⓘ
A raw staged row’s whole worker input: the reserved IV span, the stream nonce, and the parked stream.
pub fn sealed_transfer(&self, index: usize) -> &[u8] ⓘ
pub fn names_flat(&self, index: usize) -> &[u8] ⓘ
pub fn link_at(&self, index: usize) -> &LinkId
pub fn hash_at(&self, index: usize) -> &ResourceHash
Sourcepub fn mark_sent(&mut self, index: usize, part_index: usize) -> PartSendOutcome
pub fn mark_sent(&mut self, index: usize, part_index: usize) -> PartSendOutcome
The distinction RNS 1.4.2 draws between part.send() (counted toward sent_parts) and part.resend() (not counted).