You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TelemetryClient is actually generic in an (unconstrained) type C. All of the practically interesting impl's of TelemetryClient bound C: TelemetryChannel. Furthermore, the only ctors for TelemetryClient assume that C = InMemoryChannel, specifically.
For ergonomic reasons, consider hiding this abstraction from users, exposing the abstracted version separately.
One easy mechanism could be via exporting a type alias for TelemetryClient<InMemoryChannel>. But, thanks to the recent export of InMemoryChannel, users can do this themselves. My guess is that in practice, users will always want to use the default client that uses InMemoryChannel, and it would be fine to just assume this for the top-level export, letting exceptional users opt in to a more parameterized ("Ex") version.
Another way you could remove the generic parameter: enclose the channel in a Box<dyn TelemetryChannel>, at the cost of some indirection.
The text was updated successfully, but these errors were encountered:
TelemetryClient
is actually generic in an (unconstrained) typeC
. All of the practically interestingimpl
's ofTelemetryClient
boundC: TelemetryChannel
. Furthermore, the only ctors forTelemetryClient
assume thatC = InMemoryChannel
, specifically.For ergonomic reasons, consider hiding this abstraction from users, exposing the abstracted version separately.
One easy mechanism could be via exporting a type alias for
TelemetryClient<InMemoryChannel>
. But, thanks to the recent export ofInMemoryChannel
, users can do this themselves. My guess is that in practice, users will always want to use the default client that usesInMemoryChannel
, and it would be fine to just assume this for the top-level export, letting exceptional users opt in to a more parameterized ("Ex
") version.Another way you could remove the generic parameter: enclose the channel in a
Box<dyn TelemetryChannel>
, at the cost of some indirection.The text was updated successfully, but these errors were encountered: