Skip to content

Commit

Permalink
Merge pull request apache#32 from laysakura:refactor/RUST_CODER_PREFIX
Browse files Browse the repository at this point in the history
refactor: add RUST_CODER_PREFIX
  • Loading branch information
laysakura authored May 17, 2023
2 parents e02e399 + 88eda40 commit 2cb4692
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions sdks/rust/src/coders/register_coders/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@
/// // ...
/// }
/// ```
///
///
/// # Related doc
///
///
/// [Design doc: Custom Coders for the Beam Rust SDK](https://docs.google.com/document/d/1tUb8EoajRkxLW3mrJZzx6xxGhoiUSRKwVuT2uxjAeIU/edit#heading=h.mgr8mrx81tnc)
#[macro_export]
macro_rules! register_coders {
($($coder:ident),*) => {
$(
impl $crate::coders::CoderUrn for $coder {
const URN: &'static str = concat!("beam:coder:rustsdk:1.0:", stringify!($coder));
const URN: &'static str = concat!(stringify!($crate::coders::urns::RUST_CODER_PREFIX), stringify!($coder));
}
)*

Expand Down
4 changes: 3 additions & 1 deletion sdks/rust/src/coders/urns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ pub const STR_UTF8_CODER_URN: &str = "beam:coder:string_utf8:v1";
pub const VARINT_CODER_URN: &str = "beam:coder:varint:v1";

// ******* Rust coders *******
pub const GENERAL_OBJECT_CODER_URN: &str = "beam:coder:genericobjectjs:v1";
pub const RUST_CODER_PREFIX: &str = "beam:coder:rustsdk:1.0:";
pub const GENERAL_OBJECT_CODER_URN: &str =
concat!(stringify!(RUST_CODER_PREFIX), "genericobject:v1");

0 comments on commit 2cb4692

Please sign in to comment.