Struct tether_utils::tether_topics::insights::Insights
source · pub struct Insights { /* private fields */ }Implementations§
source§impl Insights
impl Insights
sourcepub fn new(options: &TopicOptions, tether_agent: &TetherAgent) -> Self
pub fn new(options: &TopicOptions, tether_agent: &TetherAgent) -> Self
Examples found in repository?
examples/api.rs (line 62)
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
fn demo_topics() {
let tether_agent = TetherAgentOptionsBuilder::new("demoTopics")
.build()
.expect("failed to init/connect Tether Agent");
let options = TopicOptions {
topic: "#".into(),
sampler_interval: 1000,
graph_enable: false,
};
let mut insights = Insights::new(&options, &tether_agent);
loop {
while let Some((_plug_name, message)) = tether_agent.check_messages() {
if insights.update(&message) {
println!("TOPICS: Insights update: \n{}", insights);
}
}
}
}pub fn sample(&mut self) -> bool
pub fn sampler(&self) -> &Sampler
sourcepub fn update(&mut self, message: &Message) -> bool
pub fn update(&mut self, message: &Message) -> bool
Examples found in repository?
examples/api.rs (line 66)
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
fn demo_topics() {
let tether_agent = TetherAgentOptionsBuilder::new("demoTopics")
.build()
.expect("failed to init/connect Tether Agent");
let options = TopicOptions {
topic: "#".into(),
sampler_interval: 1000,
graph_enable: false,
};
let mut insights = Insights::new(&options, &tether_agent);
loop {
while let Some((_plug_name, message)) = tether_agent.check_messages() {
if insights.update(&message) {
println!("TOPICS: Insights update: \n{}", insights);
}
}
}
}pub fn topics(&self) -> &[String]
pub fn roles(&self) -> &[String]
pub fn ids(&self) -> &[String]
pub fn plugs(&self) -> &[String]
pub fn trees(&self) -> &[AgentTree]
pub fn message_count(&self) -> u128
pub fn message_log( &self ) -> &CircularBuffer<MONITOR_LOG_LENGTH, (String, String)>
pub fn since_log_start(&self) -> Option<Duration>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Insights
impl RefUnwindSafe for Insights
impl Send for Insights
impl Sync for Insights
impl Unpin for Insights
impl UnwindSafe for Insights
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