pub struct Output<T: Clone + Send + 'static> { /* private fields */ }
Expand description
An output port.
Output
ports can be connected to input ports, i.e. to asynchronous model
methods that return no value. They broadcast events to all connected input
ports.
Implementations§
Source§impl<T: Clone + Send + 'static> Output<T>
impl<T: Clone + Send + 'static> Output<T>
Sourcepub fn connect<M, F, S>(
&mut self,
input: F,
address: impl Into<Address<M>>,
) -> LineId
pub fn connect<M, F, S>( &mut self, input: F, address: impl Into<Address<M>>, ) -> LineId
Adds a connection to an input port of the model specified by the address.
The input port must be an asynchronous method of a model of type M
taking as argument a value of type T
plus, optionally, a scheduler
reference.
Sourcepub fn connect_stream(&mut self) -> (EventStream<T>, LineId)
pub fn connect_stream(&mut self) -> (EventStream<T>, LineId)
Adds a connection to an event stream iterator.
Sourcepub fn connect_slot(&mut self) -> (EventSlot<T>, LineId)
pub fn connect_slot(&mut self) -> (EventSlot<T>, LineId)
Adds a connection to an event slot.
Sourcepub fn disconnect_all(&mut self)
pub fn disconnect_all(&mut self)
Removes all connections.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Output<T>
impl<T> !RefUnwindSafe for Output<T>
impl<T> Send for Output<T>
impl<T> !Sync for Output<T>
impl<T> Unpin for Output<T>
impl<T> !UnwindSafe for Output<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