Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Config
Enable and disable
By now, if a component's config appear in config, the component is considered enabled. And each component in framwork config is
Option
value.Using Builder
Configs now can be constructed from its builder, powered by crate
typed_builder
, e.g.:Unify structure
The config of a component with multimodules now have structure bellow :
()
.Init by config
A component module config can initialize the corresponded component. If there's no common config, the component config can initialize a
HashMap<String, Arc<Component>>
, where the default module is stored at entry empty string""
.Costom config can be mapped into varied rust types.
As if a csm config can be deserialized as rust type
T
, theconfig::<T> ()
call shouldn't panic now.Tracing
Now tracing has a component
TardisTracing
, user can initialize by default or customize tracing layers.By default, the tracing layers includes fmt, envfilter, opentelemetry (when tracing feature enabled), tracing appender (a file logger, when tracing_appender feature enabled) and console-subscriber (when tokio-console feature enabled)
Add a dynamic configurable layer
update config
by calling
tracing().update_config
, we can reload all configurable layer.Crypto and Digest
rust-crypto
is removed for it's unmaintained now. Using works from RustCrypto instead.Support for custom digest algorithm, result mapper and digest from iterator.
digest::Digest
Rename Aes to Aead
Now, aes algorithm accept raw bytes instead of str. Raw bytes is recommoned because from string to raw bytes is cheap while parse an hexcode is relatively expensive, and in most case we got key and data in raw bytes. User should use
random_n_bytes()
to generate random key rather thanrandom_n_hex()
.And several aead algorithms are supported, which are considered secure.
Misc
Use
for <'a>Deserialize<'a>
instead ofDeserializeOwned
The restriction of
for <'a>Deserialize<'a>
is looser.Use
impl IntoIterator<Item = T>
instead ofOption<Vec<T>>
impl IntoIterator<Item = T>
includesVec<T>
,Option<T>
and many other types.Use
impl Into<String>
instead ofString
impl Into<String>
includesString
and&str