pub struct Monitor {
pub monitor_id: String,
pub definition: MonitorDefinition,
pub runtime: MonitorRuntime,
}Fields§
§monitor_id: String§definition: MonitorDefinition§runtime: MonitorRuntimeImplementations§
Source§impl Monitor
impl Monitor
pub fn new( monitor_id: impl Into<String>, definition: MonitorDefinition, now_ms: i64, ) -> Result<Self, MonitorError>
pub fn observe( &mut self, observation: Observation, condition_matches: bool, now_ms: i64, ) -> Result<Decision, MonitorError>
pub fn timer_decision(&mut self, now_ms: i64) -> Result<Decision, MonitorError>
pub fn note_output(&mut self, now_ms: i64) -> Result<(), MonitorError>
pub fn quiet_due(&self, now_ms: i64) -> bool
pub fn polling_due(&self, now_ms: i64) -> bool
pub fn next_deadline(&self) -> Option<i64>
pub fn pause(&mut self) -> bool
pub fn resume(&mut self, now_ms: i64) -> Result<bool, MonitorError>
pub fn degrade_for_raw_gap(&mut self) -> Result<bool, MonitorError>
pub fn bump_generation(&mut self) -> Result<(), MonitorError>
pub fn note_notification( &mut self, event_id: u64, reason: EventReason, ) -> Result<(), MonitorError>
pub fn feed_output(&mut self, bytes: &[u8]) -> Result<bool, MonitorError>
pub fn validate(&self) -> Result<(), MonitorError>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Monitor
impl<'de> Deserialize<'de> for Monitor
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Monitor
impl StructuralPartialEq for Monitor
Auto Trait Implementations§
impl Freeze for Monitor
impl RefUnwindSafe for Monitor
impl Send for Monitor
impl Sync for Monitor
impl Unpin for Monitor
impl UnsafeUnpin for Monitor
impl UnwindSafe for Monitor
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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.Source§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.Source§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.Source§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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.