Make sure that the hostname part of the ServiceDefinition is valid by making the fields private and force constructing it through from_parts that includes the validation.
Allow users to resolve the ServiceDefinition once before building the LoadBalancedChannel through a new method build_and_resolve that does the same as channel only that it will only succeed if a call to LookupService::resolve_service_endpoints is successful.
This PR tries to address the following:
hostname
part of theServiceDefinition
is valid by making the fields private and force constructing it throughfrom_parts
that includes the validation.ServiceDefinition
once before building theLoadBalancedChannel
through a new methodbuild_and_resolve
that does the same aschannel
only that it will only succeed if a call toLookupService::resolve_service_endpoints
is successful.Closes #20.