Right now ConnectOptions is effectively opaque, but I want to inspect it after creation so I can log the URL that it connects to. The user of my crate creates and passes their own ConnectOptions, so I'm unable to read the URL before creation.
This PR derives Debug so that it can be debug printed, and adds url and additional_headers read-only accessor fields. It also derives Clone so that I can reuse the options for later.
IMO, these two fields should just be public. I don't see a reason to keep them private since this struct is just a data container. But for consistency with the rest of the API, and to allow extending ConnectOptions in the future without breaking existing code, I've just written accessors for the fields individually.
Right now
ConnectOptions
is effectively opaque, but I want to inspect it after creation so I can log the URL that it connects to. The user of my crate creates and passes their ownConnectOptions
, so I'm unable to read the URL before creation.This PR derives
Debug
so that it can be debug printed, and addsurl
andadditional_headers
read-only accessor fields. It also derivesClone
so that I can reuse the options for later.IMO, these two fields should just be public. I don't see a reason to keep them private since this struct is just a data container. But for consistency with the rest of the API, and to allow extending
ConnectOptions
in the future without breaking existing code, I've just written accessors for the fields individually.