pub struct NoteBook {
told_paused: HashSet<String>,
pause: Option<(i64, &'static str)>,
resume: Option<(i64, HashSet<String>)>,
}Expand description
Which agents were told delivery paused, and which still await their resume note.
Fields§
§told_paused: HashSet<String>Agents told about the current pause.
pause: Option<(i64, &'static str)>The current pause’s note, for agents that join while it lasts.
resume: Option<(i64, HashSet<String>)>Since when delivery is back, and the agents whose resume note waits for their first pull.
Implementations§
Source§impl NoteBook
impl NoteBook
Sourcepub fn pause(
&mut self,
since_ms: i64,
reason: &'static str,
agents: &[String],
) -> Vec<Note>
pub fn pause( &mut self, since_ms: i64, reason: &'static str, agents: &[String], ) -> Vec<Note>
Delivery has been paused a while: a note for every agent in agents.
Sourcepub fn pause_late_joiners(&mut self, agents: &[String]) -> Vec<Note>
pub fn pause_late_joiners(&mut self, agents: &[String]) -> Vec<Note>
While a pause note stands, agents that weren’t told yet.
Sourcepub fn resumed(&mut self, at_ms: i64)
pub fn resumed(&mut self, at_ms: i64)
Delivery is back: every agent told about the pause gets a resume
note after its first pull (see Self::fetched).
Sourcepub fn fetched(
&mut self,
agent: &str,
delivered: usize,
expired: &[ExpiredItem],
) -> Option<Note>
pub fn fetched( &mut self, agent: &str, delivered: usize, expired: &[ExpiredItem], ) -> Option<Note>
An agent’s pull came back with delivered messages and expired
reports: its resume note, or an expiry note, or nothing.
Sourcepub fn tick(&mut self, now_ms: i64) -> Vec<Note>
pub fn tick(&mut self, now_ms: i64) -> Vec<Note>
Resume notes still waiting after RESUME_NOTE_GRACE_MS go out
without a count.
fn flush_resume(&mut self) -> Vec<Note>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NoteBook
impl RefUnwindSafe for NoteBook
impl Send for NoteBook
impl Sync for NoteBook
impl Unpin for NoteBook
impl UnsafeUnpin for NoteBook
impl UnwindSafe for NoteBook
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.
§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.