pub struct StreamSender { /* private fields */ }Expand description
Sends stream events to the runtime.
Accepts Bytes, &str, String, or any serde::Serialize value
(via [emit_json]).
Implementations§
Source§impl StreamSender
impl StreamSender
Sourcepub fn new(tx: Sender<Bytes>) -> Self
pub fn new(tx: Sender<Bytes>) -> Self
Create a new StreamSender backed by the given channel sender.
In typical usage this is called internally by the Caster. Exposed publicly for testing and advanced use cases.
Sourcepub async fn emit_str(&self, data: &str) -> SdkResult<()>
pub async fn emit_str(&self, data: &str) -> SdkResult<()>
Emit a string (auto-encoded to UTF-8 bytes).
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for StreamSender
impl RefUnwindSafe for StreamSender
impl Send for StreamSender
impl Sync for StreamSender
impl Unpin for StreamSender
impl UnsafeUnpin for StreamSender
impl UnwindSafe for StreamSender
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request