Skip to main content

Crate hyperactor_macros

Crate hyperactor_macros 

Source

Attribute Macros§

export
Exports an actor so that it may be bound to [hyperactor::ActorRef]s.
export_spawn
A version of export which also makes the actor remotely spawnable.
forward
Forward messages of the provided type to this handler implementation.
instrument
Use this macro in place of tracing::instrument to prevent spamming our tracing table. We set a default level of INFO while always setting ERROR if the function returns Result::Err giving us consistent and high quality structured logs. Because this wraps around tracing::instrument, all parameters mentioned in https://fburl.com/9jlkb5q4 should be valid. For functions that don’t return a Result type, use instrument_infallible
instrument_infallible
Use this macro in place of tracing::instrument to prevent spamming our tracing table. Because this wraps around tracing::instrument, all parameters mentioned in https://fburl.com/9jlkb5q4 should be valid.

Derive Macros§

HandleClient
Derives a client implementation on ActorHandle<Actor>. See Handler documentation for details.
Handler
Derive a custom handler trait for given an enum containing tuple structs. The handler trait defines a method corresponding to each of the enum’s variants, and a handle function that dispatches messages to the correct method. The macro supports two messaging patterns: “call” and “oneway”. A call is a request-response message; a [hyperactor::mailbox::OncePortRef] or [hyperactor::mailbox::OncePortHandle] in the last position is used to send the return value.
Named
Derive the [hyperactor::data::Named] trait for a struct with the provided type URI. The name of the type is its fully-qualified Rust path. The name may be overridden by providing a string value for the name attribute.
RefClient
Derives a client implementation on ActorRef<Actor>. See Handler documentation for details.