Skip to main content

RedisBuilder

Struct RedisBuilder 

Source
pub struct RedisBuilder<S: State = Empty> { /* private fields */ }
Expand description

Use builder syntax to set the inputs and finish with build().

Implementations§

Source§

impl<S: State> RedisBuilder<S>

Source

pub fn build(self) -> Redis
where S: IsComplete,

Finish building and return the requested object

Source

pub fn memory(self, value: String) -> RedisBuilder<SetMemory<S>>
where S::Memory: IsUnset,

Optional (Some / Option setters). Memory available for data (e.g. “512Mi”, “4Gi”). None = the smallest production tier. The smallest tier that fits is used; a request larger than the biggest single-shard tier on the platform is rejected.

Source

pub fn maybe_memory(self, value: Option<String>) -> RedisBuilder<SetMemory<S>>
where S::Memory: IsUnset,

Optional (Some / Option setters). Memory available for data (e.g. “512Mi”, “4Gi”). None = the smallest production tier. The smallest tier that fits is used; a request larger than the biggest single-shard tier on the platform is rejected.

Source

pub fn eviction_policy( self, value: RedisEvictionPolicy, ) -> RedisBuilder<SetEvictionPolicy<S>>
where S::EvictionPolicy: IsUnset,

Optional (Some / Option setters). Default: <RedisEvictionPolicy as Default>::default().

What happens at the memory limit. Default volatile-lru: keys without a TTL are never evicted.

Source

pub fn maybe_eviction_policy( self, value: Option<RedisEvictionPolicy>, ) -> RedisBuilder<SetEvictionPolicy<S>>
where S::EvictionPolicy: IsUnset,

Optional (Some / Option setters). Default: <RedisEvictionPolicy as Default>::default().

What happens at the memory limit. Default volatile-lru: keys without a TTL are never evicted.

Source

pub fn persistence(self, value: bool) -> RedisBuilder<SetPersistence<S>>
where S::Persistence: IsUnset,

Optional (Some / Option setters). Default: false.

Keep data across a server restart or maintenance. Default false (a cache). On AWS, GCP and Azure this needs high_availability, because the clouds only persist data from a replicated deployment. Local always persists with an append-only file when this is on.

Source

pub fn maybe_persistence( self, value: Option<bool>, ) -> RedisBuilder<SetPersistence<S>>
where S::Persistence: IsUnset,

Optional (Some / Option setters). Default: false.

Keep data across a server restart or maintenance. Default false (a cache). On AWS, GCP and Azure this needs high_availability, because the clouds only persist data from a replicated deployment. Local always persists with an append-only file when this is on.

Source

pub fn high_availability( self, value: bool, ) -> RedisBuilder<SetHighAvailability<S>>
where S::HighAvailability: IsUnset,

Optional (Some / Option setters). Default: false.

One replica in another zone with automatic failover. Default false.

Source

pub fn maybe_high_availability( self, value: Option<bool>, ) -> RedisBuilder<SetHighAvailability<S>>
where S::HighAvailability: IsUnset,

Optional (Some / Option setters). Default: false.

One replica in another zone with automatic failover. Default false.

Source

pub fn encryption_key( self, value: ResourceRef, ) -> RedisBuilder<SetEncryptionKey<S>>
where S::EncryptionKey: IsUnset,

Optional (Some / Option setters). Customer-managed key for encryption at rest. Cannot be changed after creation.

Source

pub fn maybe_encryption_key( self, value: Option<ResourceRef>, ) -> RedisBuilder<SetEncryptionKey<S>>
where S::EncryptionKey: IsUnset,

Optional (Some / Option setters). Customer-managed key for encryption at rest. Cannot be changed after creation.

Auto Trait Implementations§

§

impl<S> Forget for RedisBuilder<S>

§

impl<S> Freeze for RedisBuilder<S>
where PhantomData<(fn() -> S, fn() -> PhantomData<Redis>)>: Freeze,

§

impl<S> Move for RedisBuilder<S>

§

impl<S> RefUnwindSafe for RedisBuilder<S>
where PhantomData<(fn() -> S, fn() -> PhantomData<Redis>)>: RefUnwindSafe,

§

impl<S> Send for RedisBuilder<S>
where PhantomData<(fn() -> S, fn() -> PhantomData<Redis>)>: Send,

§

impl<S> Sync for RedisBuilder<S>
where PhantomData<(fn() -> S, fn() -> PhantomData<Redis>)>: Sync,

§

impl<S> Unpin for RedisBuilder<S>
where PhantomData<(fn() -> S, fn() -> PhantomData<Redis>)>: Unpin,

§

impl<S> UnsafeUnpin for RedisBuilder<S>
where PhantomData<(fn() -> S, fn() -> PhantomData<Redis>)>: UnsafeUnpin,

§

impl<S> UnwindSafe for RedisBuilder<S>
where PhantomData<(fn() -> S, fn() -> PhantomData<Redis>)>: UnwindSafe,

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more