Struct RedisObjects

Source
pub struct RedisObjects { /* private fields */ }
Expand description

Handle for a pool of connections to a redis server.

Implementations§

Source§

impl RedisObjects

Source

pub fn open_host( host: &str, port: u16, db: i64, ) -> Result<Arc<Self>, ErrorTypes>

Open given more limited connection info

Source

pub fn open_host_native_tls( host: &str, port: u16, db: i64, ) -> Result<Arc<Self>, ErrorTypes>

Open a connection using the local tls configuration

Source

pub fn open(config: ConnectionInfo) -> Result<Arc<Self>, ErrorTypes>

Open a connection pool

Source

pub fn priority_queue<T: Serialize + DeserializeOwned>( self: &Arc<Self>, name: String, ) -> PriorityQueue<T>

Open a priority queue under the given key

Source

pub fn queue<T: Serialize + DeserializeOwned>( self: &Arc<Self>, name: String, ttl: Option<Duration>, ) -> Queue<T>

Open a FIFO queue under the given key

Source

pub fn multiqueue<T: Serialize + DeserializeOwned>( self: &Arc<Self>, prefix: String, ) -> MultiQueue<T>

an object that represents a set of queues with a common prefix

Source

pub fn hashmap<T: Serialize + DeserializeOwned>( self: &Arc<Self>, name: String, ttl: Option<Duration>, ) -> Hashmap<T>

Open a hash map under the given key

Source

pub fn publisher(self: &Arc<Self>, channel: String) -> Publisher

Create a sink to publish messages to a named channel

Source

pub async fn publish( &self, channel: &str, data: &[u8], ) -> Result<u32, ErrorTypes>

Write a message directly to the channel given

Source

pub async fn publish_json<T: Serialize>( &self, channel: &str, value: &T, ) -> Result<u32, ErrorTypes>

Write a json message directly to the channel given

Source

pub fn auto_exporting_metrics<T: MetricMessage>( self: &Arc<Self>, name: String, counter_type: String, ) -> AutoExportingMetricsBuilder<T>

Start building a metrics exporter

Source

pub fn pubsub_json_listener<T: DeserializeOwned + Send + 'static>( self: &Arc<Self>, ) -> JsonListenerBuilder<T>

Start building a json listener that produces a stream of events

Source

pub fn subscribe_json<T: DeserializeOwned + Send + 'static>( self: &Arc<Self>, channel: String, ) -> Receiver<Option<T>>

Build a json listener that produces a stream of events using the default configuration

Source

pub fn pubsub_listener(self: &Arc<Self>) -> ListenerBuilder

Start building a raw data listener that produces a stream of events

Source

pub fn subscribe(self: &Arc<Self>, channel: String) -> Receiver<Option<Msg>>

Build a raw data listener that produces a stream of events using the default configuration

Source

pub fn user_quota_tracker(self: &Arc<Self>, prefix: String) -> UserQuotaTracker

Open an interface for tracking user quotas on redis

Source

pub fn set<T: Serialize + DeserializeOwned>( self: &Arc<Self>, name: String, ) -> Set<T>

Open a set of values

Source

pub fn expiring_set<T: Serialize + DeserializeOwned>( self: &Arc<Self>, name: String, ttl: Option<Duration>, ) -> Set<T>

Open a set of values with an expiration policy

Source

pub async fn wipe(&self) -> Result<(), ErrorTypes>

Erase all data on the redis server

Source

pub async fn keys(&self, pattern: &str) -> Result<Vec<String>, ErrorTypes>

List all keys on the redis server that satisfies the given pattern

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ErasedDestructor for T
where T: 'static,