pub struct MessagePatternDefinition { /* private fields */ }Expand description
Framework-neutral message pattern handler definition.
Implementations§
Source§impl MessagePatternDefinition
impl MessagePatternDefinition
pub fn request<H, Fut, R>(
pattern: impl Into<String>,
handler: H,
) -> Result<Self>where
H: Fn(TransportMessage) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<R>> + Send + 'static,
R: IntoTransportReply + Send + 'static,
pub fn event<H, Fut>(pattern: impl Into<String>, handler: H) -> Result<Self>
pub fn request_json<T, H, Fut, R>( pattern: impl Into<String>, handler: H, ) -> Result<Self>
pub fn request_validated_json<T, H, Fut, R>( pattern: impl Into<String>, handler: H, ) -> Result<Self>
pub fn event_json<T, H, Fut>( pattern: impl Into<String>, handler: H, ) -> Result<Self>
pub fn event_validated_json<T, H, Fut>( pattern: impl Into<String>, handler: H, ) -> Result<Self>
pub fn pattern(&self) -> &str
pub fn kind(&self) -> MessagePatternKind
pub fn module_name(&self) -> Option<&str>
pub fn with_pipe<P>(self, pipe: P) -> Selfwhere
P: TransportPipe,
pub fn with_guard<G>(self, guard: G) -> Selfwhere
G: TransportGuard,
pub fn with_execution_guard<G>(self, guard: G) -> Selfwhere
G: Guard,
pub fn with_interceptor<I>(self, interceptor: I) -> Selfwhere
I: TransportInterceptor,
pub fn with_execution_interceptor<I>(self, interceptor: I) -> Selfwhere
I: ExecutionInterceptor,
pub fn with_payload_validation<T>(self) -> Selfwhere
T: DeserializeOwned + Validate + 'static,
pub async fn dispatch( &self, message: TransportMessage, ) -> Result<Option<TransportReply>>
Trait Implementations§
Source§impl Clone for MessagePatternDefinition
impl Clone for MessagePatternDefinition
Source§fn clone(&self) -> MessagePatternDefinition
fn clone(&self) -> MessagePatternDefinition
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for MessagePatternDefinition
impl !UnwindSafe for MessagePatternDefinition
impl Freeze for MessagePatternDefinition
impl Send for MessagePatternDefinition
impl Sync for MessagePatternDefinition
impl Unpin for MessagePatternDefinition
impl UnsafeUnpin for MessagePatternDefinition
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