async fn accept(&self, message: Message<T>) -> MessageStatus {
    let access = self.value.upgradable_read().await;
    if let Some(ref existing) = *access {
      if existing.id() == message.id() {
        return MessageStatus::Declined;
      }
    }
    let mut writer = RwLockUpgradableReadGuard::upgrade(access).await;
    (*writer).replace(message);
    self.notify.1.notify_all();
    MessageStatus::Accepted
  }
/// overwrites the available message if the new one has a different
/// id and alwyas signals changes by notifying any awaiting receives
overwrites the available message if the new one has a different
id and alwyas signals changes by notifying any awaiting receives
overwrites the available message if the new one has a different id and alwyas signals changes by notifying any awaiting receives
async fn accept(&self, message: Message<T>) -> MessageStatus {
    let access = self.value.upgradable_read().await;
    if let Some(ref existing) = *access {
      if existing.id() == message.id() {
        return MessageStatus::Declined;
      }
    }
    let mut writer = RwLockUpgradableReadGuard::upgrade(access).await;
    (*writer).replace(message);
    self.notify.1.notify_all();
    MessageStatus::Accepted
  }
async fn accept ( & self , message : Message < T > ) -> MessageStatus { let access = self . value . upgradable_read ( ) . await ; if let Some ( ref existing ) = * access { if existing . id ( ) == message . id ( ) { return MessageStatus :: Declined ; } } let mut writer = RwLockUpgradableReadGuard :: upgrade ( access ) . await ; ( * writer ) . replace ( message ) ; self . notify . 1 . notify_all ( ) ; MessageStatus :: Accepted }
overwrites the available message if the new one has a different
id and alwyas signals changes by notifying any awaiting receives
overwrites the available message if the new one has a different id and alwyas signals changes by notifying any awaiting receives
&self
message
Message<T>