Struct redis_graph::GraphConfig
source · pub struct GraphConfig {
pub values: HashMap<String, Value>,
}
Expand description
Simple wrapper around a graph config map that allows derserializing config values into rust types.
Fields§
§values: HashMap<String, Value>
Implementations§
source§impl GraphConfig
impl GraphConfig
sourcepub fn get_value<T: FromRedisValue>(&self, key: &str) -> RedisResult<Option<T>>
pub fn get_value<T: FromRedisValue>(&self, key: &str) -> RedisResult<Option<T>>
Extracts a config 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.
Trait Implementations§
source§impl Clone for GraphConfig
impl Clone for GraphConfig
source§fn clone(&self) -> GraphConfig
fn clone(&self) -> GraphConfig
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for GraphConfig
impl Debug for GraphConfig
source§impl Default for GraphConfig
impl Default for GraphConfig
source§fn default() -> GraphConfig
fn default() -> GraphConfig
Returns the “default value” for a type. Read more
source§impl FromRedisValue for GraphConfig
impl FromRedisValue for GraphConfig
source§fn from_redis_value(v: &Value) -> RedisResult<Self>
fn from_redis_value(v: &Value) -> RedisResult<Self>
Given a redis
Value
this attempts to convert it into the given
destination type. If that fails because it’s not compatible an
appropriate error is generated.source§fn from_redis_values(items: &[Value]) -> Result<Vec<Self, Global>, RedisError>
fn from_redis_values(items: &[Value]) -> Result<Vec<Self, Global>, RedisError>
Similar to
from_redis_value
but constructs a vector of objects
from another vector of values. This primarily exists internally
to customize the behavior for vectors of tuples.Auto Trait Implementations§
impl RefUnwindSafe for GraphConfig
impl Send for GraphConfig
impl Sync for GraphConfig
impl Unpin for GraphConfig
impl UnwindSafe for GraphConfig
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
Mutably borrows from an owned value. Read more