Remove Report type in iced_sentinel
This commit is contained in:
parent
dd36893f7a
commit
7f7c5ea337
3 changed files with 9 additions and 15 deletions
|
|
@ -44,7 +44,6 @@ mod internal {
|
|||
|
||||
use iced_sentinel::client::{self, Client};
|
||||
use iced_sentinel::timing::{self, Timing};
|
||||
use iced_sentinel::Report;
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::{Mutex, MutexGuard};
|
||||
|
|
@ -96,10 +95,10 @@ mod internal {
|
|||
|
||||
impl Timer {
|
||||
pub fn finish(self) {
|
||||
lock().sentinel.report(Report::Timing(Timing {
|
||||
lock().sentinel.report_timing(Timing {
|
||||
stage: self.stage,
|
||||
duration: self.start.elapsed(),
|
||||
}));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use crate::{Input, Report, SOCKET_ADDRESS};
|
||||
use crate::{Input, Timing, SOCKET_ADDRESS};
|
||||
|
||||
use tokio::io::{self, AsyncWriteExt};
|
||||
use tokio::net;
|
||||
|
|
@ -11,8 +11,8 @@ pub struct Client {
|
|||
}
|
||||
|
||||
impl Client {
|
||||
pub fn report(&mut self, report: Report) {
|
||||
let _ = self.sender.try_send(Input::Reported(report));
|
||||
pub fn report_timing(&mut self, timing: Timing) {
|
||||
let _ = self.sender.try_send(Input::TimingMeasured(timing));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,19 +17,14 @@ pub const SOCKET_ADDRESS: &str = "127.0.0.1:9167";
|
|||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub enum Input {
|
||||
Connected(Version),
|
||||
Reported(Report),
|
||||
TimingMeasured(Timing),
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum Event {
|
||||
Connected(Version),
|
||||
Disconnected,
|
||||
Reported(Report),
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub enum Report {
|
||||
Timing(Timing),
|
||||
TimingMeasured(Timing),
|
||||
}
|
||||
|
||||
pub fn run() -> impl Stream<Item = Event> {
|
||||
|
|
@ -89,8 +84,8 @@ async fn receive(
|
|||
Input::Connected(version) => {
|
||||
Event::Connected(version)
|
||||
}
|
||||
Input::Reported(report) => {
|
||||
Event::Reported(report)
|
||||
Input::TimingMeasured(timing) => {
|
||||
Event::TimingMeasured(timing)
|
||||
}
|
||||
},
|
||||
))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue