Struct osmpbfreader::objects::Tags

source ·
pub struct Tags(/* private fields */);
Expand description

Tags represents the features of the objects. See the OpenStreetMap wiki page about tags for more information.

Implementations§

source§

impl Tags

source

pub fn new() -> Tags

Creates a new, empty Tags object.

source

pub fn contains(&self, key: &str, value: &str) -> bool

Returns if it contains a tag with the given key and value.

source

pub fn into_inner(self) -> FlatMap<String, String>

Consume tags into inner FlatMap representation

Methods from Deref<Target = FlatMap<String, String>>§

source

pub fn capacity(&self) -> usize

Returns the number of elements the VecMap can hold without reallocating.

Examples
use flat_map::FlatMap;
let map: FlatMap<String, String> = FlatMap::with_capacity(10);
assert!(map.capacity() >= 10);
source

pub fn reserve(&mut self, additional: usize)

source

pub fn reserve_exact(&mut self, additional: usize)

source

pub fn shrink_to_fit(&mut self)

source

pub fn len(&self) -> usize

source

pub fn is_empty(&self) -> bool

Return true if the map contains no elements.

Examples
use flat_map::FlatMap;

let mut a = FlatMap::new();
assert!(a.is_empty());
a.insert("1", "a");
assert!(!a.is_empty());
source

pub fn iter<'r>(&'r self) -> Iter<'r, K, V>

source

pub fn iter_mut(&mut self) -> IterMut<'_, K, V>

source

pub fn values_mut(&mut self) -> ValuesMut<'_, K, V>

source

pub fn keys<'a>(&'a self) -> Keys<'a, K, V>

source

pub fn values<'a>(&'a self) -> Values<'a, K, V>

source

pub fn clear(&mut self)

source

pub fn retain<F>(&mut self, f: F)where F: FnMut(&K, &V) -> bool,

source

pub fn insert(&mut self, key: K, v: V) -> Option<V>

source

pub fn append(&mut self, other: &mut FlatMap<K, V>)

source

pub fn split_off(&mut self, key: &K) -> FlatMap<K, V>

source

pub fn get<Q>(&self, q: &Q) -> Option<&V>where K: Borrow<Q>, Q: Ord + ?Sized,

source

pub fn contains_key<Q>(&self, k: &Q) -> boolwhere K: Borrow<Q>, Q: Ord + ?Sized,

source

pub fn get_mut<Q>(&mut self, q: &Q) -> Option<&mut V>where K: Borrow<Q>, Q: Ord + ?Sized,

Return Option<&mut V>.

Example
use flat_map::FlatMap;

let mut m = FlatMap::new();
m.insert(1, "foo".to_string());
m.get_mut(&1).unwrap().push_str("bar");
assert_eq!("foobar", m.get_mut(&1).unwrap());
source

pub fn entry(&mut self, key: K) -> Entry<'_, K, V>

source

pub fn remove<Q>(&mut self, q: &Q) -> Option<V>where K: Borrow<Q>, Q: Ord + ?Sized,

Trait Implementations§

source§

impl Clone for Tags

source§

fn clone(&self) -> Tags

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Tags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Tags

source§

fn default() -> Tags

Returns the “default value” for a type. Read more
source§

impl Deref for Tags

§

type Target = FlatMap<SmartString<LazyCompact>, SmartString<LazyCompact>>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for Tags

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl<'de> Deserialize<'de> for Tags

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl FromIterator<(SmartString<LazyCompact>, SmartString<LazyCompact>)> for Tags

source§

fn from_iter<T: IntoIterator<Item = (String, String)>>(iter: T) -> Self

Creates a value from an iterator. Read more
source§

impl Hash for Tags

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for Tags

source§

fn cmp(&self, other: &Tags) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for Tags

source§

fn eq(&self, other: &Tags) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Tags

source§

fn partial_cmp(&self, other: &Tags) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Serialize for Tags

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for Tags

source§

impl StructuralEq for Tags

source§

impl StructuralPartialEq for Tags

Auto Trait Implementations§

§

impl RefUnwindSafe for Tags

§

impl Send for Tags

§

impl Sync for Tags

§

impl Unpin for Tags

§

impl UnwindSafe for Tags

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,