Struct CollectionStore

Source
pub struct CollectionStore<E, MV = NoMac> { /* private fields */ }

Implementations§

Source§

impl<E, MV> CollectionStore<E, MV>

Source

pub fn new() -> Self

Source

pub fn new_value(collection: Vec<E>) -> Self

Source

pub fn reset(&self)

Source

pub fn invalidate(&self)

Source

pub fn transfer_state(&self) -> TransferState

Source

pub fn set_transfer_state(&self, transfer_state: TransferState)

Source

pub fn reset_transfer_error(&self)

Source

pub fn loaded(&self) -> bool

Source

pub fn loaded_signal(&self) -> impl Signal<Item = bool> + use<E, MV>

Source

pub fn loaded_status(&self) -> Option<StatusCode>

Source

pub fn loaded_status_signal( &self, ) -> impl Signal<Item = Option<StatusCode>> + use<E, MV>

Source

pub fn stored(&self) -> bool

Source

pub fn stored_signal(&self) -> impl Signal<Item = bool> + use<E, MV>

Source

pub fn stored_status(&self) -> Option<StatusCode>

Source

pub fn stored_status_signal( &self, ) -> impl Signal<Item = Option<StatusCode>> + use<E, MV>

Source

pub fn pending(&self) -> bool

Source

pub fn pending_signal(&self) -> impl Signal<Item = bool> + use<E, MV>

Source

pub fn collection(&self) -> &MutableVec<E>

Source

pub fn messages(&self) -> &Messages

Source

pub fn paging(&self) -> &Mutable<Paging>

Source

pub fn is_empty(&self) -> bool

Source

pub fn any<F>(&self, f: F) -> bool
where F: Fn(&E) -> bool,

Source

pub fn all<F>(&self, f: F) -> bool
where F: Fn(&E) -> bool,

Source

pub fn lock_ref(&self) -> MutableVecLockRef<'_, E>

Source

pub fn lock_mut(&self) -> MutableVecLockMut<'_, E>

Source

pub fn inspect<F>(&self, f: F)
where F: FnOnce(&[E]),

Source

pub fn inspect_mut<F>(&self, f: F)
where F: FnOnce(&mut MutableVecLockMut<'_, E>),

Source

pub fn find_map<F, U>(&self, f: F) -> Option<U>
where F: Fn(&E) -> Option<U>,

Source

pub fn map_vec<F, U>(&self, f: F) -> U
where F: FnOnce(&[E]) -> U,

Source

pub fn map_vec_mut<F, U>(&self, f: F) -> U
where F: FnOnce(&mut MutableVecLockMut<'_, E>) -> U,

Source§

impl<E, MV> CollectionStore<E, MV>
where E: Copy,

Source

pub fn empty_signal(&self) -> impl Signal<Item = bool> + use<E, MV>

Source

pub fn collection_state_signal( &self, ) -> impl Signal<Item = CollectionState> + use<E, MV>

Source

pub fn find<F>(&self, f: F) -> Option<E>
where F: Fn(&E) -> bool,

Source

pub fn find_inspect_mut<P, F>(&self, predicate: P, f: F) -> Option<bool>
where P: FnMut(&E) -> bool, F: FnMut(&mut E) -> bool,

Source

pub fn find_set<P>(&self, predicate: P, item: E) -> bool
where P: FnMut(&E) -> bool,

Source

pub fn find_set_or_add<P>(&self, predicate: P, item: E)
where P: FnMut(&E) -> bool,

Source

pub fn replace(&self, values: Vec<E>) -> Vec<E>

Source

pub fn remove<P>(&self, predicate: P) -> bool
where P: FnMut(&E) -> bool,

Source

pub fn set_externally_loaded(&self, values: Vec<E>)

Source

pub fn signal_map<F, U>(&self, f: F) -> impl Signal<Item = U> + use<E, MV, F, U>
where F: FnMut(&[E]) -> U,

Source

pub fn signal_vec(&self) -> MutableSignalVec<E>

Source

pub fn signal_vec_filter<F>( &self, f: F, ) -> impl SignalVec<Item = E> + use<E, MV, F>
where F: FnMut(&E) -> bool,

Source

pub fn signal_vec_filter_signal<F, U>( &self, f: F, ) -> impl SignalVec<Item = E> + use<E, MV, F, U>
where F: FnMut(&E) -> U, U: Signal<Item = bool>,

Source

pub fn signal_vec_map<F, U>( &self, f: F, ) -> impl SignalVec<Item = U> + use<E, MV, F, U>
where F: FnMut(E) -> U,

Source

pub fn signal_vec_map_signal<F, U>( &self, f: F, ) -> impl SignalVec<Item = U::Item> + use<E, MV, F, U>
where F: FnMut(E) -> U, U: Signal,

Source

pub fn signal_vec_filter_map<F, U>( &self, f: F, ) -> impl SignalVec<Item = U> + use<E, MV, F, U>
where F: FnMut(E) -> Option<U>,

Source§

impl<E, MV> CollectionStore<E, MV>
where E: Clone,

Source

pub fn empty_signal_cloned(&self) -> impl Signal<Item = bool> + use<E, MV>

Source

pub fn collection_state_signal_cloned( &self, ) -> impl Signal<Item = CollectionState> + use<E, MV>

Source

pub fn find_cloned<F>(&self, f: F) -> Option<E>
where F: Fn(&E) -> bool,

Source

pub fn find_inspect_mut_cloned<P, F>(&self, predicate: P, f: F) -> Option<bool>
where P: FnMut(&E) -> bool, F: FnMut(&mut E) -> bool,

Source

pub fn get_cloned(&self) -> Vec<E>

Source

pub fn find_set_cloned<P>(&self, predicate: P, item: E) -> bool
where P: FnMut(&E) -> bool,

Source

pub fn find_set_or_add_cloned<P>(&self, predicate: P, item: E)
where P: FnMut(&E) -> bool,

Source

pub fn replace_cloned(&self, values: Vec<E>) -> Vec<E>

Source

pub fn remove_cloned<P>(&self, predicate: P) -> bool
where P: FnMut(&E) -> bool,

Source

pub fn set_externally_loaded_cloned(&self, values: Vec<E>)

Source

pub fn signal_map_cloned<F, U>( &self, f: F, ) -> impl Signal<Item = U> + use<E, MV, F, U>
where F: FnMut(&[E]) -> U,

Source

pub fn signal_vec_cloned(&self) -> MutableSignalVec<E>

Source

pub fn signal_vec_filter_cloned<F>( &self, f: F, ) -> impl SignalVec<Item = E> + use<E, MV, F>
where F: FnMut(&E) -> bool,

Source

pub fn signal_vec_filter_signal_cloned<F, U>( &self, f: F, ) -> impl SignalVec<Item = E> + use<E, MV, F, U>
where F: FnMut(&E) -> U, U: Signal<Item = bool>,

Source

pub fn signal_vec_map_cloned<F, U>( &self, f: F, ) -> impl SignalVec<Item = U> + use<E, MV, F, U>
where F: FnMut(E) -> U,

Source

pub fn signal_vec_map_signal_cloned<F, U>( &self, f: F, ) -> impl SignalVec<Item = U::Item> + use<E, MV, F, U>
where F: FnMut(E) -> U, U: Signal,

Source

pub fn signal_vec_filter_map_cloned<F, U>( &self, f: F, ) -> impl SignalVec<Item = U> + use<E, MV, F, U>
where F: FnMut(E) -> Option<U>,

Source§

impl<E, MV> CollectionStore<E, MV>
where E: Clone, MV: MacVerify,

Source

pub fn load<C>(&self, request: Request<'_>, result_callback: C)
where E: DeserializeOwned + 'static, C: FnOnce(StatusCode) + 'static,

Source

pub fn load_skip_cache<C>(&self, request: Request<'_>, result_callback: C)
where E: DeserializeOwned + 'static, C: FnOnce(StatusCode) + 'static,

Source

pub fn load_merge<F, C>( &self, request: Request<'_>, merge_fn: F, result_callback: C, )
where E: DeserializeOwned + 'static, F: FnMut(Vec<E>) + 'static, C: FnOnce(StatusCode) + 'static,

Source

pub fn store<MS, C>(&self, request: Request<'_>, result_callback: C)
where E: Serialize + DeserializeOwned + 'static, MS: MacSign, C: FnOnce(StatusCode) + 'static,

Trait Implementations§

Source§

impl<E: Debug, MV: Debug> Debug for CollectionStore<E, MV>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<E, MV> Default for CollectionStore<E, MV>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<E, MV> Freeze for CollectionStore<E, MV>

§

impl<E, MV> RefUnwindSafe for CollectionStore<E, MV>
where MV: RefUnwindSafe,

§

impl<E, MV> Send for CollectionStore<E, MV>
where MV: Send, E: Send + Sync,

§

impl<E, MV> Sync for CollectionStore<E, MV>
where MV: Sync, E: Send + Sync,

§

impl<E, MV> Unpin for CollectionStore<E, MV>
where MV: Unpin,

§

impl<E, MV> UnwindSafe for CollectionStore<E, MV>
where MV: 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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, 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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more