Skip to main content

OutgoingResources

Struct OutgoingResources 

Source
pub struct OutgoingResources<C>{ /* private fields */ }

Implementations§

Source§

impl<C> OutgoingResources<C>

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn lookup(&self, link_id: &LinkId, hash: &ResourceHash) -> Option<usize>

Source

pub fn state(&self, index: usize) -> &OutgoingResourceState

Source

pub fn state_mut(&mut self, index: usize) -> &mut OutgoingResourceState

Source

pub fn set_hash(&mut self, index: usize, hash: ResourceHash)

Source

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.

Source

pub fn sealed_transfer(&self, index: usize) -> &[u8]

Source

pub fn names_flat(&self, index: usize) -> &[u8]

Source

pub fn hash_at(&self, index: usize) -> &ResourceHash

Source

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).

Source

pub fn remove(&mut self, link_id: &LinkId, hash: &ResourceHash) -> RemoveOutcome

Source

pub fn set_timeout_at( &mut self, index: usize, timeout_at: Option<InstantMillis>, )

Source

pub fn earliest_timeout_at(&self) -> Option<InstantMillis>

Source

pub fn due_index(&self, now: InstantMillis) -> Option<usize>

Source

pub fn transfer_capacity(&self) -> usize

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Trait Implementations§

Source§

impl<C> Debug for OutgoingResources<C>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<C> Default for OutgoingResources<C>

Source§

fn default() -> OutgoingResources<C>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<C> Freeze for OutgoingResources<C>
where C: Freeze,

§

impl<C> RefUnwindSafe for OutgoingResources<C>
where C: RefUnwindSafe,

§

impl<C> Send for OutgoingResources<C>
where C: Send,

§

impl<C> Sync for OutgoingResources<C>
where C: Sync,

§

impl<C> Unpin for OutgoingResources<C>
where C: Unpin,

§

impl<C> UnsafeUnpin for OutgoingResources<C>
where C: UnsafeUnpin,

§

impl<C> UnwindSafe for OutgoingResources<C>
where C: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.