Skip to main content

LinkSegment

Struct LinkSegment 

Source
pub struct LinkSegment { /* private fields */ }
Expand description

A mapped inbox table and the region that keeps it mapped.

Implementations§

Source§

impl LinkSegment

Source

pub fn update_work_capacity(&self, joined: &Joined, limit: usize) -> Result<()>

Update admission for the receiver lane held by joined. Existing reservations and accepted work keep their tickets.

Source

pub fn reserve_work( self: &Arc<Self>, lane: usize, origin: usize, ) -> Result<Option<WorkReservation>>

Source

pub fn accept_work( self: &Arc<Self>, lane: usize, ticket: WorkTicket, ) -> Result<WorkExecution>

Source§

impl LinkSegment

Source

pub fn open(name: &str, spec: LinkSpec) -> Result<Self>

Open or create one named link inbox.

Source

pub fn adopt( name: &str, inbox_kind: u8, stream_kind: u8, ) -> Result<Option<Self>>

Attach an existing owner-only link inbox and adopt the shape its owner declared, read from the inbox and stream-table headers. Never creates: Ok(None) when the inbox or its stream table does not exist yet, so a caller observes an absent owner instead of fixing the fleet’s shape itself.

Source

pub fn open_group( name: &str, spec: LinkSpec, access: GroupAccess, ) -> Result<Self>

Open a dedicated group-shared Link, without sharing any fleet rings. The configured owner creates resources; other users attach existing ones.

Source

pub fn join( &self, service: &str, role: &str, incarnation: u64, ) -> Result<Joined>

Take a lane after reclaiming abandoned readers and queued work. Includes recovery performed while opening this mapping under producer registration pressure.

Source

pub fn join_with_capacity( &self, service: &str, role: &str, incarnation: u64, capacity: Option<usize>, ) -> Result<Joined>

Source

pub fn reclaim_if_gone(&self, lane: usize) -> Result<Option<Reclaimed>>

Take back lane if its kernel hold is free and it is still claimed or retains queued work after withdrawal. None when there is nothing to retire or its reader is still alive, including during graceful drain.

A join does this for every lane. A writer refused by a lane asks it for that lane: a process killed outright leaves its lane claimed and filling, so until the next join every writer would keep finding it full. Reclaiming announces the directory, so watchers see the departure as they see an orderly one.

Source

pub fn reclaim_if_gone_with( &self, lane: usize, recover: impl FnOnce(&Reclaimed), ) -> Result<Option<Reclaimed>>

Run resource recovery while the reclaimed lane is still kernel-held, before another participant can publish a replacement on that index.

Source

pub fn reclaim_process( &self, pid: u32, incarnation: u64, recover: impl FnMut(&Reclaimed), ) -> Result<Vec<Reclaimed>>

Recover only lanes last owned by this exact process incarnation. The caller has observed process exit; the kernel hold additionally fences this scan against a concurrent claim. Withdrawn lanes retain their stamp so a process dying during graceful drain is covered too.

Source

pub fn wait_lane_released( &self, lane: usize, pid: u32, incarnation: u64, ) -> Result<()>

Wait until the kernel has released the lane of this exited process, so that Self::reclaim_process can prove the death. An exit notification can arrive first. Blocks, and only a live holder prolongs it: a lane another process already took back returns at once.

Source

pub fn recover_producers(&self, pid: Option<u32>) -> Result<()>

Recover producer reservations after a native exit notification, or on a cold join. No PID liveness probe, timed scan or write-path lock.

Source

pub fn inbox(&self) -> &Inbox

Source

pub fn spec(&self) -> LinkSpec

Source

pub fn bodies(&self, lane: usize, incarnation: u64) -> Result<LinkBodies>

Open body streams in this Link’s exact IPC scope, not its caller’s UID.

Source

pub fn created(&self) -> bool

Source

pub fn segment_bytes(&self) -> usize

Remove the inbox name. Existing mappings remain valid.

Auto Trait Implementations§

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more