Struct otter_api_tests::shapelib::LinksTable[][src]

pub struct LinksTable(pub EnumMap<LinkKind, Option<String>>);

Methods from Deref<Target = EnumMap<LinkKind, Option<String>>>

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

Notable traits for Values<'a, V>

impl<'a, V> Iterator for Values<'a, V> where
    V: 'a, 
type Item = &'a V;

An iterator visiting all values. The iterator type is &V.

Examples

use enum_map::enum_map;

let map = enum_map! { false => 3, true => 4 };
let mut values = map.values();
assert_eq!(values.next(), Some(&3));
assert_eq!(values.next(), Some(&4));
assert_eq!(values.next(), None);

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

Notable traits for ValuesMut<'a, V>

impl<'a, V> Iterator for ValuesMut<'a, V> where
    V: 'a, 
type Item = &'a mut V;

An iterator visiting all values mutably. The iterator type is &mut V.

Examples

use enum_map::enum_map;

let mut map = enum_map! { _ => 2 };
for value in map.values_mut() {
    *value += 2;
}
assert_eq!(map[false], 4);
assert_eq!(map[true], 4);

pub fn clear(&mut self)

Clear enum map with default values.

Examples

use enum_map::{Enum, EnumMap};

#[derive(Enum)]
enum Example {
    A,
    B,
}

let mut enum_map = EnumMap::<_, String>::default();
enum_map[Example::B] = "foo".into();
enum_map.clear();
assert_eq!(enum_map[Example::A], "");
assert_eq!(enum_map[Example::B], "");

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

Notable traits for Iter<'a, K, V>

impl<'a, K, V> Iterator for Iter<'a, K, V> where
    K: Enum<V>, 
type Item = (K, &'a V);

Returns an iterator over enum map.

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

Notable traits for IterMut<'a, K, V>

impl<'a, K, V> Iterator for IterMut<'a, K, V> where
    K: Enum<V>, 
type Item = (K, &'a mut V);

Returns a mutable iterator over enum map.

pub fn len(&self) -> usize

Returns number of elements in enum map.

pub fn swap(&mut self, a: K, b: K)

Swaps two indexes.

Examples

use enum_map::enum_map;

let mut map = enum_map! { false => 0, true => 1 };
map.swap(false, true);
assert_eq!(map[false], 1);
assert_eq!(map[true], 0);

pub fn as_slice(&self) -> &[V]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]

Converts an enum map to a slice representing values.

pub fn as_mut_slice(&mut self) -> &mut [V]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]

Converts a mutable enum map to a mutable slice representing values.

Trait Implementations

impl Clone for LinksTable[src]

impl Debug for LinksTable[src]

impl Default for LinksTable[src]

impl Deref for LinksTable[src]

type Target = EnumMap<LinkKind, Option<String>>

The resulting type after dereferencing.

impl DerefMut for LinksTable[src]

impl<'de> Deserialize<'de> for LinksTable[src]

impl<'_> From<&'_ LinksTable> for Html[src]

impl Serialize for LinksTable[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Any + Send + Sync

impl<A> DynCastExt for A

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Serialize for T where
    T: Serialize + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,