Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FieldTable does not accept integer type #100

Closed
Jacobbishopxy opened this issue Jun 1, 2023 · 3 comments
Closed

FieldTable does not accept integer type #100

Jacobbishopxy opened this issue Jun 1, 2023 · 3 comments

Comments

@Jacobbishopxy
Copy link

Jacobbishopxy commented Jun 1, 2023

Hi, I was trying to create a FieldTable with an integer type, such as:

  let mut ft = FieldTable::new();
  ft.insert(
      "x-message-ttl".try_into().unwrap(),
      60000.try_into().unwrap(),
  );

and the compiler tells me that "required for {integer} to implement TryInto<amqp_serde::types::FieldValue>".
Also, I've also found that both FieldName and FieldValue are private, so that I can not create such a FieldValue from 60000.
Would you want me to create a PR to fix this small issue? I'm glad to help.

@gftea
Copy link
Owner

gftea commented Jun 1, 2023

Hi, I will reexport the amqp_serde types into amqprs namespace.
If you need a quick workaround before I release new version, you can add "amqp_serde" in your Cargo.toml, then you can use the types, because they are pub types in amqp_serde not in amqprs

@gftea
Copy link
Owner

gftea commented Jun 1, 2023

Hi, in release v1.4.0, you can access all amqp types, e.g. FieldName, FieldValue

@Jacobbishopxy
Copy link
Author

Got it! Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants