pub trait Address {
Show 39 methods
// Required methods
fn number(&self) -> i64;
fn number_mut(&mut self) -> &mut i64;
fn number_suffix(&self) -> &Option<String>;
fn number_suffix_mut(&mut self) -> &mut Option<String>;
fn directional(&self) -> &Option<StreetNamePreDirectional>;
fn directional_mut(&mut self) -> &mut Option<StreetNamePreDirectional>;
fn street_name_pre_modifier(&self) -> &Option<StreetNamePreModifier>;
fn street_name_pre_modifier_mut(
&mut self,
) -> &mut Option<StreetNamePreModifier>;
fn street_name_pre_type(&self) -> &Option<StreetNamePreType>;
fn street_name_pre_type_mut(&mut self) -> &mut Option<StreetNamePreType>;
fn street_name_separator(&self) -> &Option<StreetSeparator>;
fn street_name_separator_mut(&mut self) -> &mut Option<StreetSeparator>;
fn street_name(&self) -> &String;
fn street_name_mut(&mut self) -> &mut String;
fn street_type(&self) -> &Option<StreetNamePostType>;
fn street_type_mut(&mut self) -> &mut Option<StreetNamePostType>;
fn subaddress_id(&self) -> &Option<String>;
fn subaddress_id_mut(&mut self) -> &mut Option<String>;
fn subaddress_type(&self) -> &Option<SubaddressType>;
fn subaddress_type_mut(&mut self) -> &mut Option<SubaddressType>;
fn floor(&self) -> &Option<i64>;
fn floor_mut(&mut self) -> &mut Option<i64>;
fn building(&self) -> &Option<String>;
fn building_mut(&mut self) -> &mut Option<String>;
fn zip(&self) -> i64;
fn zip_mut(&mut self) -> &mut i64;
fn postal_community(&self) -> &String;
fn postal_community_mut(&mut self) -> &mut String;
fn state(&self) -> &State;
fn state_mut(&mut self) -> &mut State;
fn status(&self) -> &AddressStatus;
fn status_mut(&mut self) -> &mut AddressStatus;
// Provided methods
fn coincident<T: Address>(&self, other: &T) -> AddressMatch { ... }
fn label(&self) -> String { ... }
fn complete_street_name(&self, abbreviate: bool) -> String { ... }
fn common_street_name(&self) -> String { ... }
fn complete_address_number(&self) -> String { ... }
fn directional_abbreviated(&self) -> Option<String> { ... }
fn standardize(&mut self) { ... }
}Expand description
The Address trait enables the data to function as well-formed address. The methods of the
trait define values for constituent components of an address. The address components follow
the FGDC classification.
Required Methods§
Sourcefn number_mut(&mut self) -> &mut i64
fn number_mut(&mut self) -> &mut i64
The number_mut method returns a mutable reference to the address number component.
Sourcefn number_suffix(&self) -> &Option<String>
fn number_suffix(&self) -> &Option<String>
The number_suffix method returns the address number suffix component.
Sourcefn number_suffix_mut(&mut self) -> &mut Option<String>
fn number_suffix_mut(&mut self) -> &mut Option<String>
The number_suffix_mut method returns a mutable reference to the address number suffix component.
Sourcefn directional(&self) -> &Option<StreetNamePreDirectional>
fn directional(&self) -> &Option<StreetNamePreDirectional>
The directional method returns the StreetNamePreDirectional component, if any.
Sourcefn directional_mut(&mut self) -> &mut Option<StreetNamePreDirectional>
fn directional_mut(&mut self) -> &mut Option<StreetNamePreDirectional>
The directional method returns a mutable reference to the StreetNamePreDirectional value.
Sourcefn street_name_pre_modifier(&self) -> &Option<StreetNamePreModifier>
fn street_name_pre_modifier(&self) -> &Option<StreetNamePreModifier>
The street_name_pre_modifier method returns the street name pre modifier component.
Sourcefn street_name_pre_modifier_mut(&mut self) -> &mut Option<StreetNamePreModifier>
fn street_name_pre_modifier_mut(&mut self) -> &mut Option<StreetNamePreModifier>
The street_name_pre_modifier_mut method returns a mutable reference to the street name pre modifier component.
Sourcefn street_name_pre_type(&self) -> &Option<StreetNamePreType>
fn street_name_pre_type(&self) -> &Option<StreetNamePreType>
The street_name_pre_type method returns the street name pre type component.
Sourcefn street_name_pre_type_mut(&mut self) -> &mut Option<StreetNamePreType>
fn street_name_pre_type_mut(&mut self) -> &mut Option<StreetNamePreType>
The street_name_pre_type_mut method returns a mutable reference to the street name pre type component.
Sourcefn street_name_separator(&self) -> &Option<StreetSeparator>
fn street_name_separator(&self) -> &Option<StreetSeparator>
The street_name_separator method returns the separator element component.
Sourcefn street_name_separator_mut(&mut self) -> &mut Option<StreetSeparator>
fn street_name_separator_mut(&mut self) -> &mut Option<StreetSeparator>
The street_name_separator_mut method returns a mutable reference to the separator element component.
Sourcefn street_name(&self) -> &String
fn street_name(&self) -> &String
The street_name method returns the street name component.
Sourcefn street_name_mut(&mut self) -> &mut String
fn street_name_mut(&mut self) -> &mut String
The street_name_mut method returns a mutable reference to the street name component.
Sourcefn street_type(&self) -> &Option<StreetNamePostType>
fn street_type(&self) -> &Option<StreetNamePostType>
The street_type method returns the street name post type component.
Sourcefn street_type_mut(&mut self) -> &mut Option<StreetNamePostType>
fn street_type_mut(&mut self) -> &mut Option<StreetNamePostType>
The street_type_mut method returns a mutable reference to the street name post type component.
Sourcefn subaddress_id(&self) -> &Option<String>
fn subaddress_id(&self) -> &Option<String>
The subaddress_id method returns the subaddress identifier component, if any.
Sourcefn subaddress_id_mut(&mut self) -> &mut Option<String>
fn subaddress_id_mut(&mut self) -> &mut Option<String>
The subaddress_id_mut method returns a mutable reference to the vale of the subaddress identifier component.
Sourcefn subaddress_type(&self) -> &Option<SubaddressType>
fn subaddress_type(&self) -> &Option<SubaddressType>
The subaddress_type method returns the subaddress type component, if any.
Sourcefn subaddress_type_mut(&mut self) -> &mut Option<SubaddressType>
fn subaddress_type_mut(&mut self) -> &mut Option<SubaddressType>
The subaddress_type_mut method returns a mutable reference to the value of the subaddress type component.
Sourcefn floor(&self) -> &Option<i64>
fn floor(&self) -> &Option<i64>
The floor method returns the floor identifier corresponding to the Floor field in the
NENA standard, required for emergency response.
Sourcefn floor_mut(&mut self) -> &mut Option<i64>
fn floor_mut(&mut self) -> &mut Option<i64>
The floor_mut method returns a mutable reference to the value of the floor identifier.
Sourcefn building(&self) -> &Option<String>
fn building(&self) -> &Option<String>
The building method returns the building identifier corresponing to the Building field
in the NENA standard, required for emergency response.
Sourcefn building_mut(&mut self) -> &mut Option<String>
fn building_mut(&mut self) -> &mut Option<String>
The building_mut method returns a mutable reference to the value of the building
identifier.
Sourcefn zip_mut(&mut self) -> &mut i64
fn zip_mut(&mut self) -> &mut i64
The zip_mut method returns a mutable reference to the value of the zip code component.
Sourcefn postal_community(&self) -> &String
fn postal_community(&self) -> &String
The postal_community method returns the postal community component of the address, being
the unincorporated or incorporated municipality name.
Sourcefn postal_community_mut(&mut self) -> &mut String
fn postal_community_mut(&mut self) -> &mut String
The postal_community_mut method returns a mutable reference to the value of the postal
community component.
Sourcefn state_mut(&mut self) -> &mut State
fn state_mut(&mut self) -> &mut State
The state_mut method returns a mutable reference to the value of the state name
component.
Sourcefn status(&self) -> &AddressStatus
fn status(&self) -> &AddressStatus
The status method returns the local status of the address, as determined by the
relevant address authority.
Sourcefn status_mut(&mut self) -> &mut AddressStatus
fn status_mut(&mut self) -> &mut AddressStatus
The status_mut method returns a mutable reference to the value of the address status.
Provided Methods§
Sourcefn coincident<T: Address>(&self, other: &T) -> AddressMatch
fn coincident<T: Address>(&self, other: &T) -> AddressMatch
An address is coincident when the other address refers to the same assignment or
location. If the addresses are coincident, but details (such as the floor number or
address status) differ, then the differences are recorded as a vector of type Mismatch.
The results are converted to type AddressMatch.
Sourcefn label(&self) -> String
fn label(&self) -> String
Returns a String representing the address label, consisting of the complete address number, complete street name and complete subaddress, used to produce map or mailing labels.
Sourcefn complete_street_name(&self, abbreviate: bool) -> String
fn complete_street_name(&self, abbreviate: bool) -> String
The complete_street_name method returns the complete street name of the address.
Sourcefn common_street_name(&self) -> String
fn common_street_name(&self) -> String
The common_street_name method returns the street name, including any premodifier, pretype
and separator elements.
The purpose of this method is to yield values like “UPPER RIVER” as the street name instead
of “RIVER”, used in the LexisNexis::from_addresses method.
Sourcefn complete_address_number(&self) -> String
fn complete_address_number(&self) -> String
The complete_address_number method returns the address number and address number suffix,
if any, as a String.
Sourcefn directional_abbreviated(&self) -> Option<String>
fn directional_abbreviated(&self) -> Option<String>
The pre_directional field represents the street name predirectional component of the
complete street name. This function returns the cloned value of the field.
Sourcefn standardize(&mut self)
fn standardize(&mut self)
The standardize method takes county address naming conventions and converts them to city
naming conventions.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.