Skip to main content

IncomingResources

Struct IncomingResources 

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

Implementations§

Source§

impl<C> IncomingResources<C>

Source

pub fn accept( &mut self, link_id: LinkId, offer: AcceptedResource<'_>, ) -> Result<usize, AcceptIncomingResourceError>

The capacity and shape gate the engine asks at accept; policy gating happens before the offer ever reaches the table. The duplicate refusal is RNS 1.4.2 Resource.accept’s has_incoming_resource registration gate.

Source

pub fn apply_hashmap_update( &mut self, index: usize, segment: u64, names: &[u8], ) -> Result<usize, ApplyHashmapUpdateError>

RNS 1.4.2 Resource.hashmap_update. We refuse two shapes the reference mishandles:

  • Names past the part count: an IndexError off its fixed-length [None] * total_parts list, uncaught until the delivering interface’s read loop, which tears the whole interface down.
  • A segment that skips ahead of the height: lands silently while hashmap_height (a fill count, not a prefix height) inflates, so request_next reads None holes.

As the receiver we drive the requests, so a hole can only come from a sender we should not trust.

Source

pub fn place_part( &mut self, index: usize, at_part_index: usize, bytes: &[u8], ) -> PlacePartOutcome

RNS 1.4.2 Resource.receive_part’s bookkeeping half. A part before the last must fill the sdu exactly: parts land at index × sdu, so a short middle part could only corrupt.

Source

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

Source

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

Source

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

Source

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

Never payload bytes: once complete, the transfer opens in place and the plaintext emerges as a sub-slice.

Source

pub fn transfer_and_streamed_open_mut( &mut self, index: usize, ) -> (&mut [u8], &mut OpenProgress)

The sealed transfer and its streamed-open slot, borrowed together: the frontier advance and the conclusion walk them in lockstep. Never payload bytes: the transfer opens in place and the plaintext emerges as a sub-slice.

Source

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

The read-only pair for the offload’s owed-span scan and job view.

Source

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

Source

pub fn received_flags(&self, index: usize) -> &[bool]

Source

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

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 IncomingResources<C>

Source§

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

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

impl<C> Default for IncomingResources<C>

Source§

fn default() -> IncomingResources<C>

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

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

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

§

impl<C> UnwindSafe for IncomingResources<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.