[−][src]Struct ether_dream_dac_emulator::stream::Stream
A stream of communication between a DAC and a user.
The stream expects to receive Commands and responseds with DacResponses.
All communication occurs over a single TCP stream.
Implementations
impl Stream
[src]
pub fn new(dac: Addressed, stream: Async<TcpStream>) -> Result<Self>
[src]
Initialise a new Stream.
Internally this allocates a buffer of bytes whose size is the size of the largest possible Data command that may be received based on the DAC's buffer capacity.
Assumes TCP_NODELAY
is already enabled on the given TCP socket in order to adhere to the
low-latency, realtime requirements.
This function also spawns a thread used for processing output.
pub fn dac(&self) -> Addressed
[src]
Produce the current state of the DAC.
pub async fn next_points<'_>(
&'_ mut self
) -> Result<Result<Vec<DacPoint>, Underflowed>>
[src]
&'_ mut self
) -> Result<Result<Vec<DacPoint>, Underflowed>>
Handle TCP messages received on the given stream by attempting to interpret them as commands.
Once processed, each command will be responded to.
This runs forever until either an error occurs or the TCP stream is shutdown.
Returns the io::Error that caused the loop to end.
Auto Trait Implementations
impl !RefUnwindSafe for Stream
impl Send for Stream
impl Sync for Stream
impl Unpin for Stream
impl !UnwindSafe for Stream
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,