#[non_exhaustive]pub struct StreamContext<Context: ServiceContext> {
pub service: Arc<ServiceState<Context>>,
/* private fields */
}Expand description
Stream context.
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.service: Arc<ServiceState<Context>>Service shared state.
Implementations§
Source§impl<Context: ServiceContext> StreamContext<Context>
impl<Context: ServiceContext> StreamContext<Context>
Sourcepub async fn send<Subject: ToSubject>(
&self,
subject: Subject,
message: &impl Serialize,
) -> Result<PublishAckFuture, PublishError>
pub async fn send<Subject: ToSubject>( &self, subject: Subject, message: &impl Serialize, ) -> Result<PublishAckFuture, PublishError>
Publish a message to the stream.
Sourcepub async fn send_with_headers<Subject: ToSubject>(
&self,
subject: Subject,
headers: HeaderMap,
message: &impl Serialize,
) -> Result<PublishAckFuture, PublishError>
pub async fn send_with_headers<Subject: ToSubject>( &self, subject: Subject, headers: HeaderMap, message: &impl Serialize, ) -> Result<PublishAckFuture, PublishError>
Publish a message with headers to the stream.
Auto Trait Implementations§
impl<Context> Freeze for StreamContext<Context>
impl<Context> !RefUnwindSafe for StreamContext<Context>
impl<Context> Send for StreamContext<Context>
impl<Context> Sync for StreamContext<Context>
impl<Context> Unpin for StreamContext<Context>
impl<Context> UnsafeUnpin for StreamContext<Context>
impl<Context> !UnwindSafe for StreamContext<Context>
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