Struct memorix_client_redis::MemorixPubSubItem
source · pub struct MemorixPubSubItem<K, P>where
P: DeserializeOwned,{ /* private fields */ }
Implementations§
source§impl<K, P> MemorixPubSubItem<K, P>
impl<K, P> MemorixPubSubItem<K, P>
pub fn new(memorix_base: MemorixBase, id: String) -> Self
pub fn key(&self, key: &K) -> Result<String, Box<dyn Error + Sync + Send>>
pub async fn subscribe( &self, key: &K, ) -> Result<Pin<Box<dyn Stream<Item = Result<MemorixPayload<P>, Box<dyn Error + Sync + Send>>> + Send>>, Box<dyn Error + Sync + Send>>
pub async fn publish( &mut self, key: &K, payload: &P, ) -> Result<(), Box<dyn Error + Sync + Send>>
Trait Implementations§
source§impl<K: Clone, P> Clone for MemorixPubSubItem<K, P>where
P: DeserializeOwned + Clone,
impl<K: Clone, P> Clone for MemorixPubSubItem<K, P>where
P: DeserializeOwned + Clone,
source§fn clone(&self) -> MemorixPubSubItem<K, P>
fn clone(&self) -> MemorixPubSubItem<K, P>
Returns a copy 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<K, P> Freeze for MemorixPubSubItem<K, P>
impl<K, P> !RefUnwindSafe for MemorixPubSubItem<K, P>
impl<K, P> Send for MemorixPubSubItem<K, P>
impl<K, P> Sync for MemorixPubSubItem<K, P>
impl<K, P> Unpin for MemorixPubSubItem<K, P>
impl<K, P> !UnwindSafe for MemorixPubSubItem<K, P>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)