[−][src]Struct dodo::Memory
Memory storage.
This storage is quite inefficient when paired with a repository and should only be used for testing purposes or prototyping.
Locking strategy
This storage does not have any entry locking mechanism. However, it guarantees that data will not be modified while reading it.
Because there is no locking, multiple writers are allowed, causing potential data loss in certain race condition scenarios.
Implementations
impl Memory
[src]
pub fn new() -> Self
[src]
Create a new memory storage.
Examples
use dodo::prelude::*; use dodo::storage::Memory; fn main() { let memory = Memory::new(); }
Trait Implementations
impl Debug for Memory
[src]
impl Default for Memory
[src]
impl Storage for Memory
[src]
type Read = BytesReader
Reader.
type Write = BytesWriter
Writer.
type Iterator = IntoIter<Result<Uuid>>
Iterator.
fn new(&mut self) -> Result<(Uuid, Self::Write)>
[src]
fn read(&self, entry: Uuid) -> Result<Self::Read>
[src]
fn write(&mut self, entry: Uuid) -> Result<Self::Write>
[src]
fn overwrite(&mut self, entry: Uuid) -> Result<Self::Write>
[src]
fn delete(&mut self, entry: Uuid) -> Result<()>
[src]
fn clear(&mut self) -> Result<()>
[src]
fn iter(&self) -> Result<Self::Iterator>
[src]
Auto Trait Implementations
impl RefUnwindSafe for Memory
impl Send for Memory
impl Sync for Memory
impl Unpin for Memory
impl UnwindSafe for Memory
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,