Struct lib::Publisher [−][src]
pub struct Publisher { /* fields omitted */ }Expand description
Implementations
Creates a new publisher. This is done for you when you create the queries/mutations system, so you should never need to call this.
Sends the given data to the subscriptions server on the given channel. In-depth information about this process is available in the book. You should use serde to serialize anything sent here as a string (this won’t be done for you). It should then be deserialized in the appropriate subscription (which will listen for messages from here indirectly). This function will return an error if the subscriptions server was unavailable or didn’t correctly acknowledge the request.
Example
let publisher = ctx.data::<Publisher>()?; // Where `ctx` is the `async_graphql` context to a resolver. publisher.publish("new_user", user_json.to_string()).await?;
Auto Trait Implementations
impl !RefUnwindSafe for Publisherimpl !UnwindSafe for PublisherBlanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
type Output = T
type Output = TShould always be Self
pub fn vzip(self) -> VAttaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more