pub struct RwModel<I> { /* private fields */ }
Expand description
RwModel Ensure Thread safety and high performance reading and writing
Implementations§
source§impl<I: 'static> RwModel<I>
impl<I: 'static> RwModel<I>
pub fn new(x: I) -> RwModel<I>
sourcepub async fn call_mut<'a, T, R>(
&'a self,
call: impl FnOnce(&'a mut I) -> T
) -> Rwhere
T: Future<Output = R>,
pub async fn call_mut<'a, T, R>( &'a self, call: impl FnOnce(&'a mut I) -> T ) -> Rwhere T: Future<Output = R>,
Behavior through queues,thread safe call async fn write ref mut
sourcepub async fn call<'a, T, R>(&'a self, call: impl FnOnce(&'a I) -> T) -> Rwhere
T: Future<Output = R>,
pub async fn call<'a, T, R>(&'a self, call: impl FnOnce(&'a I) -> T) -> Rwhere T: Future<Output = R>,
Behavior through queues,thread safe call async fn read ref
sourcepub fn sync_call<R>(&self, call: impl FnOnce(&I) -> R) -> R
pub fn sync_call<R>(&self, call: impl FnOnce(&I) -> R) -> R
Thread safe call async fn read, Balanced queues are not supported
sourcepub fn sync_mut_call<R>(&self, call: impl FnOnce(&mut I) -> R) -> R
pub fn sync_mut_call<R>(&self, call: impl FnOnce(&mut I) -> R) -> R
Thread safe call async fn write, Balanced queues are not supported
Trait Implementations§
Auto Trait Implementations§
impl<I> !RefUnwindSafe for RwModel<I>
impl<I> Send for RwModel<I>
impl<I> Sync for RwModel<I>
impl<I> Unpin for RwModel<I>where I: Unpin,
impl<I> UnwindSafe for RwModel<I>where I: UnwindSafe,
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