pub struct SocketConnection<TInputMessage, TOutputMessage> { /* private fields */ }Expand description
Represents an incoming socket connection. When a socket is connected, we retrieve an input stream, and need to respond with an output stream.
The socket is closed when the output stream is closed, or when the connection itself is dropped.
Implementations§
Source§impl<TInputMessage, TOutputMessage> SocketConnection<TInputMessage, TOutputMessage>where
TInputMessage: 'static,
TOutputMessage: 'static,
impl<TInputMessage, TOutputMessage> SocketConnection<TInputMessage, TOutputMessage>where
TInputMessage: 'static,
TOutputMessage: 'static,
Sourcepub fn new(
context: &SceneContext,
input: impl 'static + Send + Stream<Item = TInputMessage>,
send_output: impl 'static + Send + FnOnce(&SceneContext, BoxStream<'static, TOutputMessage>),
) -> Self
pub fn new( context: &SceneContext, input: impl 'static + Send + Stream<Item = TInputMessage>, send_output: impl 'static + Send + FnOnce(&SceneContext, BoxStream<'static, TOutputMessage>), ) -> Self
Creates a new socket connection
Auto Trait Implementations§
impl<TInputMessage, TOutputMessage> Freeze for SocketConnection<TInputMessage, TOutputMessage>
impl<TInputMessage, TOutputMessage> !RefUnwindSafe for SocketConnection<TInputMessage, TOutputMessage>
impl<TInputMessage, TOutputMessage> Send for SocketConnection<TInputMessage, TOutputMessage>
impl<TInputMessage, TOutputMessage> !Sync for SocketConnection<TInputMessage, TOutputMessage>
impl<TInputMessage, TOutputMessage> Unpin for SocketConnection<TInputMessage, TOutputMessage>
impl<TInputMessage, TOutputMessage> !UnwindSafe for SocketConnection<TInputMessage, TOutputMessage>
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
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