pub struct NamedPipeRegistry { /* private fields */ }Expand description
Registry of named pipes for persistent IPC channels.
Implementations§
Source§impl NamedPipeRegistry
impl NamedPipeRegistry
Sourcepub fn create(
&self,
name: impl Into<String>,
) -> KernelResult<Receiver<KernelMessage>>
pub fn create( &self, name: impl Into<String>, ) -> KernelResult<Receiver<KernelMessage>>
Create a named pipe with default capacity and TTL.
Returns the receiver half of the pipe channel. If a pipe with this name already exists, returns an error.
Sourcepub fn create_with_options(
&self,
name: impl Into<String>,
capacity: usize,
ttl_secs: u64,
) -> KernelResult<Receiver<KernelMessage>>
pub fn create_with_options( &self, name: impl Into<String>, capacity: usize, ttl_secs: u64, ) -> KernelResult<Receiver<KernelMessage>>
Create a named pipe with specific capacity and TTL.
Sourcepub fn connect_sender(&self, name: &str) -> KernelResult<Sender<KernelMessage>>
pub fn connect_sender(&self, name: &str) -> KernelResult<Sender<KernelMessage>>
Connect to an existing named pipe as a sender.
Returns a sender that can push messages into the pipe.
Sourcepub async fn send(&self, name: &str, msg: KernelMessage) -> KernelResult<()>
pub async fn send(&self, name: &str, msg: KernelMessage) -> KernelResult<()>
Send a message to a named pipe.
This is a convenience method that looks up the pipe and sends directly, without requiring the caller to hold a sender.
Sourcepub fn disconnect_sender(&self, name: &str)
pub fn disconnect_sender(&self, name: &str)
Disconnect a sender from a named pipe.
Sourcepub fn disconnect_receiver(&self, name: &str)
pub fn disconnect_receiver(&self, name: &str)
Disconnect a receiver from a named pipe.
Sourcepub fn cleanup_expired(&self) -> Vec<String>
pub fn cleanup_expired(&self) -> Vec<String>
Remove pipes that have expired (no references and TTL elapsed).
Returns the names of removed pipes.
Trait Implementations§
Source§impl Default for NamedPipeRegistry
impl Default for NamedPipeRegistry
Source§impl Registry for NamedPipeRegistry
impl Registry for NamedPipeRegistry
Auto Trait Implementations§
impl !RefUnwindSafe for NamedPipeRegistry
impl Freeze for NamedPipeRegistry
impl Send for NamedPipeRegistry
impl Sync for NamedPipeRegistry
impl Unpin for NamedPipeRegistry
impl UnsafeUnpin for NamedPipeRegistry
impl UnwindSafe for NamedPipeRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more