Skip to content

Commit

Permalink
feat: add more helper func (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
PureWhiteWu authored Dec 20, 2023
1 parent 93c9a05 commit 9354a39
Show file tree
Hide file tree
Showing 5 changed files with 231 additions and 111 deletions.
212 changes: 114 additions & 98 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "metainfo"
version = "0.7.7"
version = "0.7.8"
authors = ["Volo Team <[email protected]>"]
edition = "2021"
description = "Transmissing metainfo across components."
Expand Down
3 changes: 3 additions & 0 deletions src/backward.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ pub trait Backward {
fn get_all_backward_transients(&self) -> Option<&AHashMap<FastStr, FastStr>>;
fn get_all_backward_downstreams(&self) -> Option<&AHashMap<FastStr, FastStr>>;

fn get_all_backward_transients_with_rpc_prefix(&self) -> Option<AHashMap<FastStr, FastStr>>;
fn get_all_backward_transients_with_http_prefix(&self) -> Option<AHashMap<FastStr, FastStr>>;

fn set_backward_transient<K: Into<FastStr>, V: Into<FastStr>>(&mut self, key: K, value: V);
fn set_backward_downstream<K: Into<FastStr>, V: Into<FastStr>>(&mut self, key: K, value: V);

Expand Down
7 changes: 7 additions & 0 deletions src/forward.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ pub trait Forward {
fn get_all_transients(&self) -> Option<&AHashMap<FastStr, FastStr>>;
fn get_all_upstreams(&self) -> Option<&AHashMap<FastStr, FastStr>>;

fn get_all_persistents_and_transients_with_rpc_prefix(
&self,
) -> Option<AHashMap<FastStr, FastStr>>;
fn get_all_persistents_and_transients_with_http_prefix(
&self,
) -> Option<AHashMap<FastStr, FastStr>>;

fn set_persistent<K: Into<FastStr>, V: Into<FastStr>>(&mut self, key: K, value: V);
fn set_transient<K: Into<FastStr>, V: Into<FastStr>>(&mut self, key: K, value: V);
fn set_upstream<K: Into<FastStr>, V: Into<FastStr>>(&mut self, key: K, value: V);
Expand Down
Loading

0 comments on commit 9354a39

Please sign in to comment.