Struct redisai::RedisAIClient[][src]

pub struct RedisAIClient {
    pub debug: bool,
}

To use the RedisAIClient you need to create a redis-rs client. redis-rs

use redisai::{RedisAIClient, AIDataType};
use redis::Client;
let aiclient: RedisAIClient = RedisAIClient { debug: false };
let client = Client::open("redis://127.0.0.1/").unwrap();
let mut con = client.get_connection().unwrap();

let tensor: Vec<f64> = vec![1., 2., 3., 4.];
let shape: Vec<usize> = vec![4];
    aiclient.ai_tensorset(
        &mut con,
        "one_dim_double_tensor".to_string(),
        AIDataType::DOUBLE,
         shape,
         tensor
    );

Fields

debug: bool

Implementations

impl RedisAIClient[src]

pub fn ai_loadbackend(
    &self,
    con: &mut Connection,
    identifier: String,
    path: String
) -> RedisResult<()>
[src]

impl RedisAIClient[src]

pub fn ai_infoget(
    &self,
    con: &mut Connection,
    key: Option<String>
) -> RedisResult<AIInfo>
[src]

pub fn ai_inforeset(&self, con: &mut Connection, key: String) -> RedisResult<()>[src]

impl RedisAIClient[src]

pub fn ai_tensorset<T>(
    &self,
    con: &mut Connection,
    key: String,
    dtype: AIDataType,
    shape: Vec<usize>,
    tensor: Vec<T>
) -> RedisResult<()> where
    Vec<T>: ToFromBlob
[src]

pub fn ai_tensorget<T>(
    &self,
    con: &mut Connection,
    key: String
) -> RedisResult<AITensor<T>> where
    T: Debug + FromRedisValue + ToFromBlob
[src]

Trait Implementations

impl Clone for RedisAIClient[src]

impl Debug for RedisAIClient[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> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[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.