Skip to main content

Applied

Enum Applied 

Source
pub enum Applied {
    Missing = -2,
    NotMet = 0,
    Ok = 1,
    Deleted = 2,
}
Expand description

What setting a deadline did.

Not called Set, because crate::Set is a set and two types with that name in one crate is a trap for whoever reads it next.

The numbers are Redis’s, from the SetExRes enum in t_hash.c, and they are what HEXPIRE puts in its reply array. They are here rather than in the protocol layer because they are semantics: whether a past deadline deletes the field or stores it is a decision about the data structure, and the reply just reports it.

EXPIRE on a whole key produces the same four outcomes and reports them with two numbers instead of four, so Keyspace::expire answers this and the wire folds it. EXPIRE cannot tell you whether the key went away or the deadline went on, and this can.

Variants§

§

Missing = -2

No such field, or no such key. Redis replies -2 for a field, and does the same for a hash that is not there at all, because a missing key and an empty hash are the same thing.

§

NotMet = 0

The condition was not met, so nothing changed. Redis replies 0.

§

Ok = 1

Set or updated. Redis replies 1.

§

Deleted = 2

The deadline was already in the past, so the field is gone rather than expiring later. Redis replies 2, and the caller has to actually remove the field, because this structure holds deadlines and not fields.

Trait Implementations§

Source§

impl Clone for Applied

Source§

fn clone(&self) -> Applied

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Applied

Source§

impl Debug for Applied

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Applied

Source§

impl PartialEq for Applied

Source§

fn eq(&self, other: &Applied) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Applied

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.