pub struct LinkSegment { /* private fields */ }Expand description
A mapped inbox table and the region that keeps it mapped.
Implementations§
Source§impl LinkSegment
impl LinkSegment
Sourcepub fn update_work_capacity(&self, joined: &Joined, limit: usize) -> Result<()>
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.
pub fn reserve_work( self: &Arc<Self>, lane: usize, origin: usize, ) -> Result<Option<WorkReservation>>
pub fn accept_work( self: &Arc<Self>, lane: usize, ticket: WorkTicket, ) -> Result<WorkExecution>
Source§impl LinkSegment
impl LinkSegment
Sourcepub fn adopt(
name: &str,
inbox_kind: u8,
stream_kind: u8,
) -> Result<Option<Self>>
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.
Sourcepub fn open_group(
name: &str,
spec: LinkSpec,
access: GroupAccess,
) -> Result<Self>
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.
Sourcepub fn join(
&self,
service: &str,
role: &str,
incarnation: u64,
) -> Result<Joined>
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.
pub fn join_with_capacity( &self, service: &str, role: &str, incarnation: u64, capacity: Option<usize>, ) -> Result<Joined>
Sourcepub fn reclaim_if_gone(&self, lane: usize) -> Result<Option<Reclaimed>>
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.
Sourcepub fn reclaim_if_gone_with(
&self,
lane: usize,
recover: impl FnOnce(&Reclaimed),
) -> Result<Option<Reclaimed>>
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.
Sourcepub fn reclaim_process(
&self,
pid: u32,
incarnation: u64,
recover: impl FnMut(&Reclaimed),
) -> Result<Vec<Reclaimed>>
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.
Sourcepub fn wait_lane_released(
&self,
lane: usize,
pid: u32,
incarnation: u64,
) -> Result<()>
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.
Sourcepub fn recover_producers(&self, pid: Option<u32>) -> Result<()>
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.
pub fn inbox(&self) -> &Inbox
pub fn spec(&self) -> LinkSpec
Sourcepub fn bodies(&self, lane: usize, incarnation: u64) -> Result<LinkBodies>
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.