minghuaw / azeventhubs

Unofficial Azure Event Hubs SDK over AMQP 1.0 for rust
5 stars 2 forks source link

Rename `azeventhubs` constructor methods to reflect that a `Result` is returned #13

Closed minghuaw closed 1 year ago

minghuaw commented 1 year ago

The current constructor methods for EventHubConnection, EventHubConsumerClient, and EventHubProducerClient are in the form of from_xxx but returns a Result. This seems not strictly following the convention that from_xxx methods should not return a result, and it should be changed to be in the form of try_from_xxx if a result is returned.

minghuaw commented 1 year ago

Summary of method name change proposal(s):

  1. from_connection_string() -> try_from_connection_string()
  2. from_connection_string() -> new_from_connection_string()
  3. from_namespace_and_credential() -> new_from_credential()
  4. from_namespace_and_named_key_credential() -> new_from_named_key_credential()
  5. from_namespace_and_sas_credential() -> new_from_sas_credential()

This comment will be updated as more ideas come up

jackgerrits commented 1 year ago

I don't have a strong opinion here. I like the removal of namespace from the name though as to me the key differentiating factor here is the method to authenticate.

minghuaw commented 1 year ago

I don't have a strong opinion here. I like the removal of namespace from the name though as to me the key differentiating factor here is the method to authenticate.

Thanks for your input. I am planning to make this change in "0.14.1" and mark the original methods as deprecated

minghuaw commented 1 year ago

A new version "0.14.1" has been released on crates.io