Skip to main content

PropGet

Trait PropGet 

Source
pub trait PropGet<K> {
    type Output: Sized;

    // Required method
    fn get(&self, key: K) -> Self::Output;

    // Provided methods
    fn map<F, O>(self, fun: F) -> Map<Self, F>
       where Self: Sized,
             F: Fn(Self::Output) -> O { ... }
    fn by_ref(&self) -> &Self { ... }
}
Expand description

An abstract property that maps keys in domain K to the corresponding values.

Required Associated Types§

Required Methods§

Source

fn get(&self, key: K) -> Self::Output

Returns the value associated with key.

Provided Methods§

Source

fn map<F, O>(self, fun: F) -> Map<Self, F>
where Self: Sized, F: Fn(Self::Output) -> O,

Creates a mapped property that maps each property value using fun.

Source

fn by_ref(&self) -> &Self

Returns a reference to this property.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'a, K, P: PropGet<K>> PropGet<K> for &'a P

Source§

type Output = <P as PropGet<K>>::Output

Source§

fn get(&self, key: K) -> Self::Output

Implementors§

Source§

impl PropGet<u32> for CVertexIndexProp

Source§

impl<E: EdgeImpl> PropGet<E> for CEdgeIndexProp<E>

Source§

impl<F, I, T> PropGet<I> for FnProp<F>
where F: Fn(I) -> T, T: Sized,

Source§

impl<I, P, D> PropGet<I> for ArrayProp<P, D>
where P: PropGet<I, Output = usize>, D: Index<usize>, D::Output: Clone + Sized,

Source§

impl<K, P, F, O> PropGet<K> for Map<P, F>
where P: PropGet<K>, F: Fn(P::Output) -> O,

Source§

impl<K: StaticEdgeKind> PropGet<<K as StaticEdgeKind>::Edge> for SEdgeIndexProp<K>

Source§

impl<V: Num> PropGet<V> for SVertexIndexProp