pub struct PortCtx<S: Polarity, H> { /* private fields */ }
Expand description
Wrapper around a handoff to differentiate between output and input.
Implementations§
source§impl<H: Handoff> PortCtx<SEND, H>
impl<H: Handoff> PortCtx<SEND, H>
Context provided to a subgraph for reading from a handoff. Corresponds to a SendPort
.
sourcepub fn give<T>(&self, item: T) -> Twhere
H: CanReceive<T>,
pub fn give<T>(&self, item: T) -> Twhere
H: CanReceive<T>,
Alias for Handoff::give
on the inner H
.
sourcepub fn try_give<T>(&self, item: T) -> Result<T, T>where
H: TryCanReceive<T>,
pub fn try_give<T>(&self, item: T) -> Result<T, T>where
H: TryCanReceive<T>,
Alias for Handoff::try_give
on the inner H
.
source§impl<H: Handoff> PortCtx<RECV, H>
impl<H: Handoff> PortCtx<RECV, H>
Context provided to a subgraph for reading from a handoff. Corresponds to a RecvPort
.
sourcepub fn take_inner(&self) -> H::Inner
pub fn take_inner(&self) -> H::Inner
See Handoff::take_inner
.
sourcepub fn borrow_mut_swap(&self) -> RefMut<'_, H::Inner>
pub fn borrow_mut_swap(&self) -> RefMut<'_, H::Inner>
Trait Implementations§
Auto Trait Implementations§
impl<S, H> Freeze for PortCtx<S, H>where
H: Freeze,
impl<S, H> RefUnwindSafe for PortCtx<S, H>where
H: RefUnwindSafe,
S: RefUnwindSafe,
impl<S, H> !Send for PortCtx<S, H>
impl<S, H> !Sync for PortCtx<S, H>
impl<S, H> Unpin for PortCtx<S, H>where
H: Unpin,
impl<S, H> UnwindSafe for PortCtx<S, H>where
H: UnwindSafe,
S: RefUnwindSafe,
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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