#[repr(u8)]pub enum Granularity {
GranularityUnspecified = 0,
SubPremise = 1,
Premise = 2,
PremiseProximity = 3,
Block = 4,
Route = 5,
Other = 6,
}Expand description
The various granularities that an address or a geocode can have. When used
to indicate granularity for an address, these values indicate with how fine
a granularity the address identifies a mailing destination. For example, an
address such as “123 Main Street, Redwood City, CA, 94061” identifies a
PREMISE while something like “Redwood City, CA, 94061” identifies a
LOCALITY. However, if we are unable to find a geocode for “123 Main
Street” in Redwood City, the geocode returned might be of LOCALITY
granularity even though the address is more granular.
Address granularity refers to the level of detail used in determining the
specificity of an address or geocode. Address specificity in the
validationGranularity response is a key signal for whether or not an
address is deliverable.
The verdict property returns these granularity signals:
-
inputGranularity— Describes the level of detail captured from the address sent to the Address Validation API. The level of address detail in the request influences the level of address detail in the validation response. For example, an address with an inputGranularity belowPREMISEbelow level does not typically result in avalidationGranularityto aPREMISElevel. -
validationGranularity— The granularity level that the Address Validation API can fully validate the address to. In most cases, a granularity level ofPREMISEorSUB_PREMISEindicates a quality address that is likely deliverable. -
geocodeGranularity— Describes the level of detail of the geocode associated with the address. For example, Google records might indicate the existence of an apartment number, but not a precise location for that particular apartment within a large apartment complex. In that case, thevalidationGranularityisSUB_PREMISEbut thegeocodeGranularityis
Variants§
GranularityUnspecified = 0
Default value. This value is unused.
SubPremise = 1
Below-building level result, such as an apartment.
Premise = 2
Building-level result.
PremiseProximity = 3
A geocode that approximates the building-level location of the address.
Block = 4
The address or geocode indicates a block. Only used in regions which have block-level addressing, such as Japan.
Route = 5
The geocode or address is granular to route, such as a street, road, or highway.
Other = 6
All other granularities, which are bucketed together since they are not deliverable.
Trait Implementations§
Source§impl AsRef<str> for Granularity
impl AsRef<str> for Granularity
Source§impl Clone for Granularity
impl Clone for Granularity
Source§fn clone(&self) -> Granularity
fn clone(&self) -> Granularity
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Granularity
impl Debug for Granularity
Source§impl Default for Granularity
impl Default for Granularity
Source§fn default() -> Granularity
fn default() -> Granularity
Source§impl<'de> Deserialize<'de> for Granularity
impl<'de> Deserialize<'de> for Granularity
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for Granularity
impl Display for Granularity
Source§impl FromStr for Granularity
impl FromStr for Granularity
Source§impl Hash for Granularity
impl Hash for Granularity
Source§impl IntoEnumIterator for Granularity
impl IntoEnumIterator for Granularity
Source§impl Ord for Granularity
impl Ord for Granularity
Source§fn cmp(&self, other: &Granularity) -> Ordering
fn cmp(&self, other: &Granularity) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for Granularity
impl PartialEq for Granularity
Source§impl PartialOrd for Granularity
impl PartialOrd for Granularity
Source§impl Serialize for Granularity
impl Serialize for Granularity
Source§impl TryFrom<&str> for Granularity
impl TryFrom<&str> for Granularity
impl Copy for Granularity
impl Eq for Granularity
impl StructuralPartialEq for Granularity
Auto Trait Implementations§
impl Freeze for Granularity
impl RefUnwindSafe for Granularity
impl Send for Granularity
impl Sync for Granularity
impl Unpin for Granularity
impl UnsafeUnpin for Granularity
impl UnwindSafe for Granularity
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.