pub struct MultiStream<B: EventStreamBackend> {
pub logger: Arc<ServerLogger>,
/* private fields */
}Expand description
Manages multiple streams with synchronization logic based on shared bindings.
This struct handles the creation and alignment of streams to ensure proper synchronization when bindings (e.g., buffers) are shared across different streams.
Fields§
§logger: Arc<ServerLogger>The logger used by the server.
Implementations§
Source§impl<B: EventStreamBackend> MultiStream<B>
impl<B: EventStreamBackend> MultiStream<B>
Sourcepub fn new(logger: Arc<ServerLogger>, backend: B, max_streams: u8) -> Self
pub fn new(logger: Arc<ServerLogger>, backend: B, max_streams: u8) -> Self
Creates an empty multi-stream.
Sourcepub fn resolve<'a>(
&mut self,
stream_id: StreamId,
bindings: impl Iterator<Item = &'a Binding>,
) -> ResolvedStreams<'_, B>
pub fn resolve<'a>( &mut self, stream_id: StreamId, bindings: impl Iterator<Item = &'a Binding>, ) -> ResolvedStreams<'_, B>
Resolves and returns a mutable reference to the stream for the given ID, performing any necessary alignment based on the provided bindings.
This method ensures that the stream is synchronized with any shared bindings from other streams before returning the stream reference.
Trait Implementations§
Auto Trait Implementations§
impl<B> Freeze for MultiStream<B>where
B: Freeze,
impl<B> RefUnwindSafe for MultiStream<B>
impl<B> Send for MultiStream<B>
impl<B> Sync for MultiStream<B>
impl<B> Unpin for MultiStream<B>
impl<B> UnwindSafe for MultiStream<B>
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