pub struct Mux { /* private fields */ }Implementations§
Source§impl Mux
impl Mux
Sourcepub fn new(
handle: &Handle,
ctx: ScriptCtx,
open: OpenSession,
) -> Result<(Self, Receiver<String>), SessionError>
pub fn new( handle: &Handle, ctx: ScriptCtx, open: OpenSession, ) -> Result<(Self, Receiver<String>), SessionError>
Opens stream 0. Every reply, from every stream, goes to the returned
receiver; it ends once the Mux and the last worker are gone.
§Errors
Stream 0 could not be built.
Sourcepub fn frame(&mut self, frame: &str) -> Option<String>
pub fn frame(&mut self, frame: &str) -> Option<String>
Handles one frame and never waits. Every error is a reply: the refusal to write, when the frame got one at once.
Sourcepub async fn ready(&self, frame: &str)
pub async fn ready(&self, frame: &str)
Waits until the stream frame requests has room in its queue, so the
next Mux::frame queues it instead of answering busy. Returns at
once for control frames, unopened streams and unreadable heads.
Sourcepub fn replies(&self) -> Sender<String>
pub fn replies(&self) -> Sender<String>
A sender into the reply channel, for a reader that writes the refusals
Mux::frame returns.
pub fn abort_handle(&self) -> AbortHandle
Auto Trait Implementations§
impl !RefUnwindSafe for Mux
impl !UnwindSafe for Mux
impl Freeze for Mux
impl Send for Mux
impl Sync for Mux
impl Unpin for Mux
impl UnsafeUnpin for Mux
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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