pub struct InMemoryStore<T> { /* private fields */ }Expand description
This is the crate users will import. It re-exports the internal pieces use nestforge::{NestForgeFactory, ModuleDefinition, Container};
Implementations§
Source§impl<T> InMemoryStore<T>where
T: Identifiable + Clone,
impl<T> InMemoryStore<T>where
T: Identifiable + Clone,
pub fn new() -> InMemoryStore<T>
pub fn with_seed(seed: Vec<T>) -> InMemoryStore<T>
pub fn find_all(&self) -> Vec<T>
pub fn find_by_id(&self, id: u64) -> Option<T>
pub fn create(&self, item: T) -> T
pub fn update_by_id<F>(&self, id: u64, updater: F) -> Option<T>
Trait Implementations§
Source§impl<T> Clone for InMemoryStore<T>where
T: Clone,
impl<T> Clone for InMemoryStore<T>where
T: Clone,
Source§fn clone(&self) -> InMemoryStore<T>
fn clone(&self) -> InMemoryStore<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<T> Freeze for InMemoryStore<T>
impl<T> RefUnwindSafe for InMemoryStore<T>
impl<T> Send for InMemoryStore<T>
impl<T> Sync for InMemoryStore<T>
impl<T> Unpin for InMemoryStore<T>
impl<T> UnsafeUnpin for InMemoryStore<T>
impl<T> UnwindSafe for InMemoryStore<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more