[−][src]Struct spartan_lib::core::db::VecDatabase
Vec
-based database
Internally contains only Vec
of messages,
so lookups based on query may be slower, than with TreeDatabase
Currently used only for testing purposes due to simple implementation details
Trait Implementations
impl<M> Database<M> for VecDatabase<M>
[src]
type PositionKey = usize
pub fn push_raw(&mut self, message: M)
[src]
pub fn position<F>(&self, predicate: F) -> Option<Self::PositionKey> where
F: Fn(&M) -> bool,
[src]
F: Fn(&M) -> bool,
pub fn get(&self, position: Self::PositionKey) -> Option<&M>
[src]
pub fn get_mut(&mut self, position: Self::PositionKey) -> Option<&mut M>
[src]
pub fn delete_pos(&mut self, position: Self::PositionKey) -> Option<M>
[src]
pub fn retain<F>(&mut self, predicate: F) where
F: Fn(&M) -> bool,
[src]
F: Fn(&M) -> bool,
pub fn len(&self) -> usize
[src]
pub fn is_empty(&self) -> bool
[src]
pub fn clear(&mut self)
[src]
impl<M: Debug> Debug for VecDatabase<M>
[src]
impl<M> Default for VecDatabase<M>
[src]
impl<'de, M> Deserialize<'de> for VecDatabase<M> where
M: Deserialize<'de>,
[src]
M: Deserialize<'de>,
pub fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<M> Serialize for VecDatabase<M> where
M: Serialize,
[src]
M: Serialize,
pub fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<M> StatusAwareDatabase<M> for VecDatabase<M> where
M: Identifiable,
[src]
M: Identifiable,
type RequeueKey = <M as Identifiable>::Id
pub fn reserve(&mut self, position: Self::PositionKey) -> Option<&mut M>
[src]
pub fn requeue<F>(
&mut self,
position: Self::RequeueKey,
predicate: F
) -> Option<&mut M> where
F: Fn(&M) -> bool,
[src]
&mut self,
position: Self::RequeueKey,
predicate: F
) -> Option<&mut M> where
F: Fn(&M) -> bool,
Auto Trait Implementations
impl<M> RefUnwindSafe for VecDatabase<M> where
M: RefUnwindSafe,
[src]
M: RefUnwindSafe,
impl<M> Send for VecDatabase<M> where
M: Send,
[src]
M: Send,
impl<M> Sync for VecDatabase<M> where
M: Sync,
[src]
M: Sync,
impl<M> Unpin for VecDatabase<M> where
M: Unpin,
[src]
M: Unpin,
impl<M> UnwindSafe for VecDatabase<M> where
M: UnwindSafe,
[src]
M: UnwindSafe,
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
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.
pub 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.
pub 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>,