pub struct Port<T: Sync> { /* private fields */ }Expand description
Represents a port, which carries values of type T.
Ports reify the data inputs and outputs of a reactor.
They may be bound to another port, in which case the upstream port forwards all values to the output port (logically instantaneously). A port may have only one upstream binding.
Output ports may also be explicitly set within a reaction, in which case they may not have an upstream port binding.
Those structural constraints are trusted to have been verified by the code generator. If necessary we may be able to add conditional compilation flags that enable runtime checks.
Trait Implementations§
Source§impl<T: Sync> ReactionTrigger<T> for Port<T>
impl<T: Sync> ReactionTrigger<T> for Port<T>
Source§fn is_present(&self, _now: &EventTag, _start: &Instant) -> bool
fn is_present(&self, _now: &EventTag, _start: &Instant) -> bool
Returns whether the trigger is present, given that
the current logical time is the parameter.
Source§fn get_value(&self, _now: &EventTag, _start: &Instant) -> Option<T>where
T: Copy,
fn get_value(&self, _now: &EventTag, _start: &Instant) -> Option<T>where
T: Copy,
Copies the value out, if it is present. Whether a value
is present is not in general the same thing as whether this trigger
Self::is_present. See crate::ReactionCtx::get.
Auto Trait Implementations§
impl<T> Freeze for Port<T>
impl<T> !RefUnwindSafe for Port<T>
impl<T> !Send for Port<T>
impl<T> !Sync for Port<T>
impl<T> Unpin for Port<T>
impl<T> !UnwindSafe for Port<T>
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