Crate steelmill

source ·

Modules§

  • A Daemon-ized wrapper around slog that provides Factory- and Daemon-scoped structured logging. This is included in this crate because Factory emits uses this Daemon to provide runtime diagnostic information.

Structs§

  • A helper data structure for DaemonBundle’s. DaemonField’s are threadsafe and immutable once set. Attempts to set them multiple times result in an error. This allows you to safely register Daemons without having a mut reference to your Factory or DaemonBundle.
  • A DaemonRef`` is like an std::sync::Arc`, except:
  • The main entry-point for steelmill. A Factory manages a set of Daemons via the generic DaemonBundle type. Application-provided Daemon methods return the application-specific generic error type, E.

Enums§

  • Errors returned by Factory, including a Cancellation error that means we are in the process of shutting down.

Traits§

  • Application-level services that are managed by Factory. A Daemon is the unit of depenency injection, and includes methods that allow the factory to manage Daemon lifecycles. Although lifecycle management is handled via this trait (and therefore the async_trait crate, which incurs runtime overhead), application specific interfaces are generally provided directly by the Daemon without any virtual method or other runtime overhead.
  • The DaemonGetter trait is implemented for DaemonField<T>, which returns Arc<T>. However, we don’t allow code to use Arc::clone() during forward operation. Therefore, the public API of Factory always converts DaemonField<T> to DaemonRef<T>, or (via this trait, which is only used by prepare(), start(), and stop()) to `&dyn Daemon``

Functions§

  • XXX get rid of this pub! Do not invoke this function directly. It is only exposed in the public API for test purposes, and will be deleted later.

Type Aliases§