pub struct FleetObserver { /* private fields */ }Expand description
Read-only namespace handle for inspecting an existing SHM fleet.
Unlike Fleet, this handle has no node id, creates no rings, and can
never publish, reset, or unlink. Opening a ring maps only an object that
already exists; dropping the observer or a ring view only unmaps local
memory.
Implementations§
Source§impl FleetObserver
impl FleetObserver
Sourcepub fn attach_existing(name: impl Into<String>) -> Result<Self>
pub fn attach_existing(name: impl Into<String>) -> Result<Self>
Create an observer for the effective user’s existing fleet namespace.
This constructor itself performs no SHM operation. Each Self::ring
call attaches to one exact existing kind and returns NotFound when it
is absent.
Sourcepub fn attach_existing_for_uid(
name: impl Into<String>,
uid: u32,
) -> Result<Self>
pub fn attach_existing_for_uid( name: impl Into<String>, uid: u32, ) -> Result<Self>
Address an explicit uid-scoped fleet namespace.
POSIX permissions still decide whether the caller may read another user’s SHM objects.
pub fn name(&self) -> &str
pub fn uid(&self) -> u32
Sourcepub fn ring(&self, kind: u8) -> Result<ShmRingView>
pub fn ring(&self, kind: u8) -> Result<ShmRingView>
Attach read-only to one exact existing ring kind.
Sourcepub fn ring_with_policy(
&self,
kind: u8,
policy: ShmAccessPolicy,
) -> Result<ShmRingView>
pub fn ring_with_policy( &self, kind: u8, policy: ShmAccessPolicy, ) -> Result<ShmRingView>
Attach read-only using an explicit per-ring maximum access policy.
Sourcepub fn typed_ring<T: OrbitTyped>(&self) -> Result<ShmRingView>
pub fn typed_ring<T: OrbitTyped>(&self) -> Result<ShmRingView>
Attach read-only and verify a linked OrbitTyped contract.
Sourcepub fn typed_ring_with_policy<T: OrbitTyped>(
&self,
policy: ShmAccessPolicy,
) -> Result<ShmRingView>
pub fn typed_ring_with_policy<T: OrbitTyped>( &self, policy: ShmAccessPolicy, ) -> Result<ShmRingView>
Attach with a policy and additionally verify the typed ring layout.