#[non_exhaustive]pub struct StreamConn {
pub inbound: InboundStream,
pub outbound: Option<OutboundSender>,
}Expand description
A live stream connection returned by a StreamHandler. The transport plugin
(e.g. folk-plugin-grpc) adapts its own stream type (tonic Streaming) into
this transport-agnostic pair; the bridge in folk-ext drives it.
#[non_exhaustive]: construct via StreamConn::server_streaming /
StreamConn::duplex so future fields (deadlines, trailing metadata) can be
added without breaking transport plugins.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.inbound: InboundStreamServer → client messages. Always present.
outbound: Option<OutboundSender>Client → server channel. None for server-streaming (the client sends
nothing after the initial request); Some for client-streaming / bidi.
Implementations§
Source§impl StreamConn
impl StreamConn
Sourcepub fn server_streaming(inbound: InboundStream) -> Self
pub fn server_streaming(inbound: InboundStream) -> Self
Server-streaming: one request already sent at open, only inbound messages.
Sourcepub fn duplex(inbound: InboundStream, outbound: OutboundSender) -> Self
pub fn duplex(inbound: InboundStream, outbound: OutboundSender) -> Self
Client-streaming / bidi: messages flow in both directions.
Auto Trait Implementations§
impl !RefUnwindSafe for StreamConn
impl !Sync for StreamConn
impl !UnwindSafe for StreamConn
impl Freeze for StreamConn
impl Send for StreamConn
impl Unpin for StreamConn
impl UnsafeUnpin for StreamConn
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