pub struct Topic { /* private fields */ }Expand description
PubSub topic channel.
Can accumulate values (accumulate=true) or clear each step.
Used for the TASKS channel (holds Send objects).
Implementations§
Trait Implementations§
Source§impl Channel for Topic
impl Channel for Topic
Source§fn checkpoint(&self) -> Option<JsonValue>
fn checkpoint(&self) -> Option<JsonValue>
Return a serializable checkpoint of this channel’s state.
Returns None if the channel is empty (MISSING).
Source§fn from_checkpoint(&self, checkpoint: Option<&JsonValue>) -> Box<dyn Channel>
fn from_checkpoint(&self, checkpoint: Option<&JsonValue>) -> Box<dyn Channel>
Restore channel state from a checkpoint.
Source§fn update(&self, values: &[JsonValue]) -> Result<bool, ChannelError>
fn update(&self, values: &[JsonValue]) -> Result<bool, ChannelError>
Apply a batch of updates. Returns true if the channel was modified.
Source§fn get(&self) -> Result<JsonValue, ChannelError>
fn get(&self) -> Result<JsonValue, ChannelError>
Get the current value. Returns Err(EmptyChannel) if empty.
Source§fn consume(&self) -> bool
fn consume(&self) -> bool
Notify that a subscribed task consumed the value.
Returns true if the channel was modified.
Source§fn is_available(&self) -> bool
fn is_available(&self) -> bool
Return true if the channel has a value available.
Source§fn clone_channel(&self) -> Box<dyn Channel>
fn clone_channel(&self) -> Box<dyn Channel>
Clone this channel (for checkpoint restoration).
Auto Trait Implementations§
impl !Freeze for Topic
impl !RefUnwindSafe for Topic
impl Send for Topic
impl Sync for Topic
impl Unpin for Topic
impl UnsafeUnpin for Topic
impl UnwindSafe for Topic
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