Struct ReadableCache

Source
pub struct ReadableCache<D, T>
where D: VectorEngine<T> + 'static + Send, T: Serialize + for<'de> Deserialize<'de> + 'static + Debug + Clone + Send + Sync,
{ /* private fields */ }

Implementations§

Source§

impl<D, T> ReadableCache<D, T>
where D: VectorEngine<T> + 'static + Send, T: Serialize + for<'de> Deserialize<'de> + 'static + Debug + Clone + Send + Sync,

Source

pub fn new( static_repository: String, dynamic_repository: String, initial_size_if_not_exists: u64, ) -> Self

Source

pub fn getting(&self, index: u64) -> T

Source

pub fn getting_lot(&self, index: u64, count: u64) -> Vec<T>

Source

pub fn add_to_cache(&self, index: u64, data: T)

Source

pub fn add_bulk_to_cache(&self, index: u64, objs: Vec<T>)

Source

pub fn get_length(&self) -> usize

Source

pub fn add(&self, obj: T)

Source

pub fn add_bulk(&self, objs: Vec<T>)

Trait Implementations§

Source§

impl<D, T> VectorEngine<T> for ReadableCache<D, T>
where D: VectorEngine<T> + 'static + Send + Sync, T: Serialize + for<'de> Deserialize<'de> + 'static + Debug + Clone + Send + Sync,

Source§

fn new( static_repository: String, dynamic_repository: String, initial_size_if_not_exists: u64, ) -> Self

Source§

fn len(&self) -> usize

Source§

fn push(&self, obj: T)

Source§

fn pushx(&self, objs: Vec<T>)

Source§

fn pull(&self, index: u64) -> T

Source§

fn pullx(&self, index: u64, count: u64) -> Vec<T>

Source§

fn is_empty(&self) -> bool

Source§

fn get(&self, index: u64) -> Option<T>

Source§

fn getx(&self, index: u64, count: u64) -> Option<Vec<T>>

Source§

fn getall(&self) -> Option<Vec<T>>

Auto Trait Implementations§

§

impl<D, T> Freeze for ReadableCache<D, T>
where D: Freeze,

§

impl<D, T> RefUnwindSafe for ReadableCache<D, T>
where D: RefUnwindSafe,

§

impl<D, T> Send for ReadableCache<D, T>

§

impl<D, T> Sync for ReadableCache<D, T>
where D: Sync,

§

impl<D, T> Unpin for ReadableCache<D, T>
where D: Unpin,

§

impl<D, T> UnwindSafe for ReadableCache<D, T>
where D: 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.