pub struct Attribution {
pub provider: String,
pub provider_uri: Option<Url>,
}Expand description
Information about data providers of this place.
Attribution provides credit and source information for place data, ensuring proper recognition of data contributors and compliance with data usage requirements.
This information should be displayed when showing place data to users, helping maintain transparency about data sources and provider relationships.
Fields§
§provider: StringName of the place’s data provider.
The display name or organization name of the entity that provided this place data. This should be shown to users to give proper credit to data sources and maintain transparency about information origins.
provider_uri: Option<Url>URI to the place’s data provider.
Optional link to the data provider’s website, profile, or more information about the source. This can be used to create clickable attribution links that direct users to learn more about the data provider.
Implementations§
Source§impl Attribution
impl Attribution
Sourcepub fn provider(&self) -> &String
pub fn provider(&self) -> &String
Name of the place’s data provider.
The display name or organization name of the entity that provided this place data. This should be shown to users to give proper credit to data sources and maintain transparency about information origins.
Sourcepub fn provider_uri(&self) -> &Option<Url>
pub fn provider_uri(&self) -> &Option<Url>
URI to the place’s data provider.
Optional link to the data provider’s website, profile, or more information about the source. This can be used to create clickable attribution links that direct users to learn more about the data provider.
Source§impl Attribution
impl Attribution
Sourcepub fn new(provider: impl Into<String>) -> Self
pub fn new(provider: impl Into<String>) -> Self
Creates a new Attribution with the specified provider name.
Used to construct attribution information with just the provider name. The provider URI can be added separately if available.
Sourcepub fn with_uri(
provider: impl Into<String>,
provider_uri: &str,
) -> Result<Self, Error>
pub fn with_uri( provider: impl Into<String>, provider_uri: &str, ) -> Result<Self, Error>
Creates a new Attribution with both provider name and URI.
Used when complete attribution information is available, including a link to the data provider’s website or profile page.
Sourcepub const fn has_link(&self) -> bool
pub const fn has_link(&self) -> bool
Returns whether this attribution has a clickable link.
Used to determine if the attribution should be displayed as a link or plain text, enabling appropriate UI rendering for attribution credits.
Sourcepub fn is_valid(&self) -> bool
pub fn is_valid(&self) -> bool
Returns whether this attribution has valid provider information.
Used to validate attribution data before displaying it to users, ensuring that meaningful attribution information is available.
Sourcepub fn display_text(&self) -> String
pub fn display_text(&self) -> String
Gets a display-friendly attribution text.
Provides formatted attribution text suitable for displaying in user interfaces, typically in the format “Data provided by [Provider]”.
Sourcepub fn short_display_text(&self) -> String
pub fn short_display_text(&self) -> String
Gets a short attribution text for compact displays.
Provides brief attribution text suitable for space-constrained interfaces like mobile apps, map overlays, or footer areas.
Sourcepub fn to_html(&self) -> String
pub fn to_html(&self) -> String
Generates HTML markup for the attribution.
Creates appropriate HTML markup with proper links if a provider URI is available, suitable for web applications and HTML-based displays.
Sourcepub fn to_markdown(&self) -> String
pub fn to_markdown(&self) -> String
Generates markdown markup for the attribution.
Creates markdown-formatted attribution text with links where appropriate, useful for documentation, README files, or markdown-based content.
Sourcepub fn should_display_prominently(&self) -> bool
pub fn should_display_prominently(&self) -> bool
Returns whether this attribution should be prominently displayed.
Used to determine attribution display priority, with certain providers or data types requiring more prominent attribution display.
Sourcepub fn provider_domain(&self) -> Option<&str>
pub fn provider_domain(&self) -> Option<&str>
Gets the domain from the provider URI if available.
Extracts the domain portion of the provider URI for display purposes or security checks, useful for showing compact attribution information.
Sourcepub fn link_description(&self) -> Option<String>
pub fn link_description(&self) -> Option<String>
Creates a user-friendly link description.
Generates descriptive text for links that provides context about where the link leads, useful for accessibility and user experience.
Trait Implementations§
Source§impl Clone for Attribution
impl Clone for Attribution
Source§fn clone(&self) -> Attribution
fn clone(&self) -> Attribution
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Attribution
impl Debug for Attribution
Source§impl<'de> Deserialize<'de> for Attribution
impl<'de> Deserialize<'de> for Attribution
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 Hash for Attribution
impl Hash for Attribution
Source§impl PartialEq for Attribution
impl PartialEq for Attribution
Source§impl Serialize for Attribution
impl Serialize for Attribution
impl Eq for Attribution
impl StructuralPartialEq for Attribution
Auto Trait Implementations§
impl Freeze for Attribution
impl RefUnwindSafe for Attribution
impl Send for Attribution
impl Sync for Attribution
impl Unpin for Attribution
impl UnwindSafe for Attribution
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> 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.