Crate rust_utils

Source
Expand description

§Rust Utilities

This crate has various utilty functions that I use in the programs I have written

§Features

  • futures: Utilities to make working with async code easier
  • linux: Linux specific utilities

Modules§

config
Basic config API
futures
Utilities for dealing with futures and asynchronous Rust APIs
linux
Linux specific utilities
logging
Rotating logging API This can be used to create a configurable log that saves to a file and optionally prints to stdout as well.
utils
Miscellaneous convenience functions

Macros§

hash_map
Convenience macro to create a HashMap from a predfined set of key - value pairs
new_default
A macro that implements [Default] for a type if its inherent implementation has a Self::new() -> Self method
tests
Convenience macro for generating a test module from a set of functions

Attribute Macros§

chainable
Convenience macro that generates builder-like chainable methods from setter or adder methods in an inherent implementation, trait definition, or from fields in a struct
config
Convenience macro to quickly create an implementation of the Config trait. This also automatically implements the Serialize and Deserialize traits from the [serde] crate (requires the feature serde_derive)
encapsulated
Java style encapsulation for struct fields

Derive Macros§

New
A derive macro that implements an inherent Self::new() method if [Default] is already implemented (can be derived)