Module near_async::messaging

source ·

Structs§

  • Sometimes we want to be able to pass in a sender that has not yet been fully constructed. LateBoundSender can act as a placeholder to pass CanSend and CanSendAsync capabilities through to the inner object. bind() should be called when the inner object is ready. All calls to send() and send_async() through this wrapper will block until bind() is called.
  • Used to implement an async sender. An async sender is just a Sender whose message is MessageWithCallback<M, R>, which is a message plus a callback function (which resolves the future that send_async returns).
  • Wraps a CanSend. This should be used to pass around an Arc<dyn CanSend>, instead of spelling out that type. Using a wrapper struct allows us to define more flexible APIs.

Enums§

Traits§

  • Trait for sending a typed message.
  • A trait for converting something that implements individual senders into a multi-sender.
  • Extension functions to wrap a CanSend as a Sender.
  • Extension trait (not for anyone to implement), that allows a Sender<MessageWithCallback<M, R>> to be used to send a message and then getting a future of the response.

Functions§

  • Creates a no-op sender that does nothing with the message.

Type Aliases§