Given the spec path for an Address, parses and returns its AddressFamily.
// TODO: break up AddressMapper rather than using private APIs
family = address_mapper._maybe_family(directory.path)
if not family:
raise ResolveError("No addresses registered in {}".format(directory))
return family
class UnhydratedStruct(datatype("UnhydratedStruct", ["address", "struct", "dependencies"])):
A product type that holds a Struct which has not yet been hydrated.
After Change
def parse_address_family(address_mapper, directory):
Given a Directory, parses and returns its AddressFamily (which may be empty, but not None).
return address_mapper.family(directory.path)
class UnhydratedStruct(datatype("UnhydratedStruct", ["address", "struct", "dependencies"])):
A product type that holds a Struct which has not yet been hydrated.