Skip to main content

Crate rofr

Crate rofr 

Source
Expand description

RoFr is a general-purpose framework for creating RPC-like APIs in Rust using NATS messaging. It also happens to be good for building robot software.

§API stability

While this crate is pre v1, the API can and will change without warning.

Re-exports§

pub use async_trait;
pub use futures;

Modules§

header
Header keys used in various NATS metadata.

Structs§

Bytes
A cheaply cloneable and sliceable chunk of contiguous memory.
Cluster
Cluster definition.
Endpoint
Endpoint definition.
Error
Error type for service endpoints.
Request
Request wrapper type for endpoint request bodies
RequestContext
Request context.
Response
Successful response wrapper
Service
Service definition.
ServiceState
Shared service state.
Stream
Stream definition.
StreamContext
Stream context.

Enums§

ClientError
Client error.

Traits§

EndpointHandler
ServiceContext
Marker trait for service context types.
StreamHandler

Functions§

generate_request_id
Generates a new unique request id.

Attribute Macros§

endpoint
Transforms a handler function into a NATS service endpoint.
service
Generates a service API description from a trait.
stream
Transforms a stream handler function into a NATS JetStream publisher.