Comments (3)
Can you show the code?
redis-rs will automatically decode the returned data to the type you specifiied. In the case of zrangebyscore this should probably be Vec<String>
. What type did you specify?
from redis-rs.
First of all thanks for the quick response. If I specify the type for the result variable "res_str" I have a problem at compilation time. It says to me:
let res_str:Vec<String>=con.zrangebyscore_withscores(key, 0, 1436537637)
expected collections::vec::Vec<collections::string::String>
,
found core::result::Result<_, redis::types::RedisError>
I also tried to use the match structure to divide the correct result from the error but any time when I execute the code it goes in the error branch.
Sorry but I don't have too much experience with Rust and I'm learning with the experience.
How do you cast the result variables?
from redis-rs.
There are multiple ways, depending on what you need: https://github.com/badboy/redis-zrangescore-example/blob/master/src/main.rs#L16-L29
(Oh, and I discovered a small bug writing this)
from redis-rs.
Related Issues (20)
- Things to complete for 0.26v HOT 3
- ConnectionManager with broken pipe HOT 2
- Issue with a simple GET command HOT 3
- Warning about Rust 2024 with the newest Nightly Compiler: `this function depends on never type fallback being ()` HOT 18
- [Redis Cluster] How scan by every nodes HOT 3
- is there a reason test_block_on_all_panics_from_spawns test is not marked as #[should_panic]? HOT 2
- Blocking operations and aio MultiplexedConnection HOT 14
- Master with given name not found in sentinel- MasterNameNotFoundBySentinel HOT 6
- Connection Timeout leads to data corruption HOT 1
- My Redis server enabled kerber verification, Can I use this client for it? HOT 1
- Support `query_async` for `ClusterPipeline` HOT 5
- Using redis with rustls is blocking HOT 2
- Alternatives to aio::Connection in combination with WATCH HOT 1
- How to dynamically reconstruct a Redis client based on cluster information? HOT 3
- EVALSHA in cluster pipelines HOT 1
- bug: Compilation error when compiling `sentinel` feature without `aio` feature, due to a configured-out struct being used.
- Things for version 0.27
- The remote host forcibly closed an existing connection. (os error 10054) HOT 5
- When building a ClusterClient using urls, the url param protocol=resp3 has no effect. HOT 1
- `tokio::sync::broadcast` support in async connection push senders HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redis-rs.