Struct Cache

Source
pub struct Cache<K: WritableType + ReadableType, V: WritableType + ReadableType> {
    pub _name: String,
    /* private fields */
}
Expand description

Ignite key-value cache. This cache is strongly typed and reading/writing some other types leads to errors. All caches created from the single IgniteClient shares the common TCP connection

Fields§

§_name: String

Implementations§

Source§

impl<K: WritableType + ReadableType, V: WritableType + ReadableType> Cache<K, V>

Source

pub fn get(&self, key: &K) -> IgniteResult<Option<V>>

Source

pub fn get_all(&self, keys: &[K]) -> IgniteResult<Vec<(Option<K>, Option<V>)>>

Source

pub fn put(&self, key: &K, value: &V) -> IgniteResult<()>

Source

pub fn put_all(&self, pairs: &[(K, V)]) -> IgniteResult<()>

Source

pub fn contains_key(&self, key: &K) -> IgniteResult<bool>

Source

pub fn contains_keys(&self, keys: &[K]) -> IgniteResult<bool>

Source

pub fn get_and_put(&self, key: &K, value: &V) -> IgniteResult<Option<V>>

Source

pub fn get_and_replace(&self, key: &K, value: &V) -> IgniteResult<Option<V>>

Source

pub fn get_and_remove(&self, key: &K) -> IgniteResult<Option<V>>

Source

pub fn put_if_absent(&self, key: &K, value: &V) -> IgniteResult<bool>

Source

pub fn get_and_put_if_absent( &self, key: &K, value: &V, ) -> IgniteResult<Option<V>>

Source

pub fn replace(&self, key: &K, value: &V) -> IgniteResult<bool>

Source

pub fn replace_if_equals(&self, key: &K, old: &V, new: &V) -> IgniteResult<bool>

Source

pub fn clear(&self) -> IgniteResult<()>

Source

pub fn clear_key(&self, key: &K) -> IgniteResult<()>

Source

pub fn clear_keys(&self, keys: &[K]) -> IgniteResult<()>

Source

pub fn remove_key(&self, key: &K) -> IgniteResult<bool>

Source

pub fn remove_if_equals(&self, key: &K, value: &V) -> IgniteResult<bool>

Source

pub fn get_size(&self) -> IgniteResult<i64>

Source

pub fn get_size_peek_mode(&self, mode: CachePeekMode) -> IgniteResult<i64>

Source

pub fn get_size_peek_modes( &self, modes: Vec<CachePeekMode>, ) -> IgniteResult<i64>

Source

pub fn remove_keys(&self, keys: &[K]) -> IgniteResult<()>

Source

pub fn remove_all(&self) -> IgniteResult<()>

Auto Trait Implementations§

§

impl<K, V> Freeze for Cache<K, V>

§

impl<K, V> RefUnwindSafe for Cache<K, V>

§

impl<K, V> Send for Cache<K, V>
where K: Send, V: Send,

§

impl<K, V> Sync for Cache<K, V>
where K: Sync, V: Sync,

§

impl<K, V> Unpin for Cache<K, V>
where K: Unpin, V: Unpin,

§

impl<K, V> UnwindSafe for Cache<K, V>
where K: UnwindSafe, V: 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<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.