pub struct Client { /* private fields */ }Expand description
A running Procwire client.
Use emit() to send events to the parent.
Use wait_for_shutdown() to block until the connection closes.
Implementations§
Source§impl Client
impl Client
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Create a new client builder.
Sourcepub async fn emit<T: Serialize>(&self, event: &str, data: &T) -> Result<()>
pub async fn emit<T: Serialize>(&self, event: &str, data: &T) -> Result<()>
Emit an event to the parent (fire-and-forget).
Events are one-way messages that don’t expect a response.
Sourcepub async fn emit_raw(&self, event: &str, data: &[u8]) -> Result<()>
pub async fn emit_raw(&self, event: &str, data: &[u8]) -> Result<()>
Emit an event with raw bytes payload.
Sourcepub fn is_backpressure_active(&self) -> bool
pub fn is_backpressure_active(&self) -> bool
Get the current backpressure status.
Sourcepub fn pending_frames(&self) -> usize
pub fn pending_frames(&self) -> usize
Get the current pending frame count.
Sourcepub async fn wait_for_shutdown(self) -> Result<()>
pub async fn wait_for_shutdown(self) -> Result<()>
Wait for shutdown (pipe close or parent kill).
This consumes the client and blocks until the connection closes.
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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