pub struct InMemoryStore<T> { /* private fields */ }Available on crate feature
testkit only.Expand description
A store of one object type.
Implementations§
Source§impl<T: Stored> InMemoryStore<T>
impl<T: Stored> InMemoryStore<T>
Sourcepub fn with_page_size(max_page: usize) -> Self
pub fn with_page_size(max_page: usize) -> Self
An empty store with a specific page size, for testing a crawl over several pages.
Sourcepub fn put(&self, item: T) -> bool
pub fn put(&self, item: T) -> bool
Inserts or replaces an object, keyed case-insensitively by its id.
Returns whether the object was newly created, which is what decides between HTTP 201 and
HTTP 200 on a PUT.
Trait Implementations§
Source§impl<T: Debug> Debug for InMemoryStore<T>
impl<T: Debug> Debug for InMemoryStore<T>
Source§impl<T: Default> Default for InMemoryStore<T>
impl<T: Default> Default for InMemoryStore<T>
Source§fn default() -> InMemoryStore<T>
fn default() -> InMemoryStore<T>
Returns the “default value” for a type. Read more
Auto 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