pub trait WithProperties {
    // Required method
    fn get_property_value(&self, key: &str) -> Option<&Value>;

    // Provided methods
    fn get_property<T: FromRedisValue>(
        &self,
        key: &str
    ) -> RedisResult<Option<T>> { ... }
    fn get_property_option<T: FromRedisValue>(&self, key: &str) -> Option<T> { ... }
}
Expand description

Enhances object like graph values (Node, Relation) that contain a map of properties with extraction function that allow parsing of the inner Redis values into requested types.

Required Methods§

source

fn get_property_value(&self, key: &str) -> Option<&Value>

Returns a raw Redis value at key.

Provided Methods§

source

fn get_property<T: FromRedisValue>(&self, key: &str) -> RedisResult<Option<T>>

Extracts a property Redis value at key into an Option of the desired type. Will return None in case the key did not exists. Will return an error in case the value at key failed to be parsed into T.

source

fn get_property_option<T: FromRedisValue>(&self, key: &str) -> Option<T>

Extracts a property Redis value at key into an Option of the desired type. Will return None in case of the key did not exist or the value at key failed to be parsed into T.

Implementors§

source§

impl WithProperties for NodeValue

Allows property extraction on NodeValues.

source§

impl WithProperties for RelationValue

Allows property extraction on RelationValues.